The correct order to load Google Client api gapi and angular js
问题 It's kind of tricky how to load js files in an Angular project together with Google Client js api. This question is talking about the correct order of doing this. Angular Js and google api client.js (gapi) And there is an Official Doc talking about this, https://cloud.google.com/developers/articles/angularjs-cloud-endpoints-recipe-for-building-modern-web-applications/. One thing in the doc is that it uses window.init() inside of init which will be causing an infinite loop. As willlma pointed