我在钓鱼器2中收到“错误:拒绝访问属性“拒绝”的权限”错误。请参见下图:
Firefox的屏幕截图
我在services.js文件中添加了以下代码
getFooter(){
return this.http.get(this.cons.footer)
.map(response => response.json());
}
我在组件文件中使用了以下代码
ngOnInit(){
this._pageService.getFooter()
.subscribe(
data => this.data = data.data,
error => console.log(error)
);
}
我正在使用下面的json文件。
{
"status": "success",
"data": {
"qwqw":"qqq",
"footer_column_first": [
"Alien Education",
"Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley. ",
[
[
"http://facebook.com",
"uploads/453085f6fb34252eeb15e26c381daf9b.jpg"
],
[
"http://twitter.com",
"uploads/8c542d463e812318f71271a41850fd41.jpg"
],
[
"http://linkedin.com",
"uploads/c29507573b1434ae96783c749248d958.jpg"
],
[
"http://youtube.com",
"uploads/e311b879e07c9a6a8c924f758566e28f.jpg"
]
]
]
}
}
我在模板(“ .html”)中使用了打击代码。但我正在错误以下
{{ console.log(data.qwqw) }}
data?.qwqw
在变量中使用问号将确保它var
不是未定义的
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句