Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/angular/28.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript 错误:无法在窗口[Angular2]中执行postMessage_Javascript_Angular - Fatal编程技术网

Javascript 错误:无法在窗口[Angular2]中执行postMessage

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(); 设置超

我已经为Angular 2创建了一个Google身份验证模块。我的一个用户在使用Google App Engine时遇到此问题-

代码-
导出类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(“电子邮件”);
}
}