Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/typescript/9.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
使用angular 6从google address api获得响应后无法创建服务_Angular_Typescript_Google Maps Api 3_Angular6 - Fatal编程技术网

使用angular 6从google address api获得响应后无法创建服务

使用angular 6从google address api获得响应后无法创建服务,angular,typescript,google-maps-api-3,angular6,Angular,Typescript,Google Maps Api 3,Angular6,我正在我的Angular 6应用程序中集成google地址API。因此,我已将代码复制到我的ts并更改为TypeScript格式。API调用正在成功进行。结果也在填充,但唯一的约束是我无法将值指定给角度模型。我试图将值传递给函数以进行服务调用。我得到了这个错误: TypeError:this.addressUpdated不是函数 addressUpdated(val:any):无效{ console.log(val) } fillInAddress(){ var place=autocomple

我正在我的Angular 6应用程序中集成google地址API。因此,我已将代码复制到我的
ts
并更改为TypeScript格式。API调用正在成功进行。结果也在填充,但唯一的约束是我无法将值指定给角度模型。我试图将值传递给函数以进行服务调用。我得到了这个错误:

TypeError:this.addressUpdated不是函数

addressUpdated(val:any):无效{
console.log(val)
}
fillInAddress(){
var place=autocomplete.getPlace();
让outputdata:any={};
for(componentForm中的var组件){
//document.getElementById(组件).value='';
//document.getElementById(组件).disabled=false;
}
对于(变量i=0;i
我试图将该值附加到输入文本框中

(<HTMLInputElement>document.getElementById(component)).value = '';
(document.getElementById(component)).value='';
但我犯了这个错误

TypeError:无法将属性“value”设置为null


我在上面的代码中看不到这个.upsateaddress。它在哪里使用?对不起,方法名是AddressUpdatedId。是否尝试导入google地图的类型?npm安装@types/googlemaps——保存dev,这可能会让您了解正在发生的事情。链接到GitHub项目:这看起来不像google maps api问题,而是一个配置错误的angular应用程序或使用typescript时的一些基本错误。请提供完整的类,不仅要更新问题中的代码,还要与实际代码进行比较。调用
fillInAddress()
方法是什么?也许这是从外部角度发生的,因此方法没有定义。
(<HTMLInputElement>document.getElementById(component)).value = '';