Javascript 错误:无法在窗口[Angular2]中执行postMessage
我已经为Angular 2创建了一个Google身份验证模块。我的一个用户在使用Google App Engine时遇到此问题- 代码-Javascript 错误:无法在窗口[Angular2]中执行postMessage,javascript,angular,Javascript,Angular,我已经为Angular 2创建了一个Google身份验证模块。我的一个用户在使用Google App Engine时遇到此问题- 代码- 导出类LoginComponent实现OnInit{ imageURL:字符串; 电子邮件:字符串; 名称:字符串; 令牌:字符串; 构造函数(私有auth:AuthService,私有区域:NgZone){} 恩戈尼尼特(){ AppGlobals.GOOGLE_CLIENT_ID=Constants.CLIENT_ID; 这是getData(); 设置超
导出类LoginComponent实现OnInit{
imageURL:字符串;
电子邮件:字符串;
名称:字符串;
令牌:字符串;
构造函数(私有auth:AuthService,私有区域:NgZone){}
恩戈尼尼特(){
AppGlobals.GOOGLE_CLIENT_ID=Constants.CLIENT_ID;
这是getData();
设置超时(()=>{
this.googleaauthenticate();
gapi.client.load(Constants.nameProyect,'v1',null,'/'+window.location.host+'/'u ah/api');
}, 2000);
}
googleAuthenticate(){
此.auth.authenticateUser((结果)=>{
此.zone.run(()=>{
这是getData();
});
});
}
getData(){
this.token=localStorage.getItem('token');
this.imageURL=localStorage.getItem('image');
this.name=localStorage.getItem('name');
this.email=localStorage.getItem('email');
}
注销(){
常数this=这个;
this.auth.userLogout(函数(){
_这是clearLocalStorage();
});
}
clearLocalStorage(){
localStorage.removietem('token');
localStorage.removietem('image');
localStorage.removietem('name');
localStorage.removietem(“电子邮件”);
}
}