google sign-in with angular2 and typescript - where to get gapi?

I also had same problem in Angular v4.0. Removing async defer from the Google platform API script solved my problem

My Problem was like below when I used Google platform api like :

<script src="https://apis.google.com/js/platform.js" async defer></script>

enter image description here

I solved my problem by discarding async defer from Google platform api script as like below in my index.html :

<script src="https://apis.google.com/js/platform.js"></script>

Have you included the Google platform API script?

<script src="https://apis.google.com/js/platform.js"></script>

See this question for instructions on how to wait for the GAPI script to load before executing your code.