基本上,我已经创建了一个Angular服务(Angular8,这就是为什么以前的解决方案可能不起作用的原因),它为谷歌SignIn调用谷歌Api (gapi)。(other gapi calls)
这个服务在我的本地服务器(localhost:4200)上工作得很好,即使编译器有一个错误消息。Did you mean the instance member 'this.gapi'?但是,当我尝试运行npm run build将其部署到服务器上
/angular-scenario.js:20892:81)
at http://0.0.0.0:9000/bower_components/angular-scenario/angular-scenario.js://0.0.0.0:9000/bower_components/angular-gapi/modules/gapi-client.js:121:32
Angular新手:我得到了gapi is not defined,因为sydney.userAuthed是在API加载之前调用的。但是我不明白为什么在创建控制器时调用方法sydney.auth。:8888/js/api.js:36:8) at new LoginController(http://localhost:888