Angular 我有;内部错误中的错误:意外插值“;在9中运行npm start时出错
我在运行Angular 我有;内部错误中的错误:意外插值“;在9中运行npm start时出错,angular,angular9,Angular,Angular9,我在运行npm start时出现此错误: [HPM] Subscribed to http-proxy events: [ 'error', 'close' ] chunk {main} main.js, main.js.map (main) 2.16 kB [initial] [rendered] chunk {polyfills} polyfills.js, polyfills.js.map (polyfills) 722 bytes [initial] [rendered] chunk
npm start
时出现此错误:
[HPM] Subscribed to http-proxy events: [ 'error', 'close' ]
chunk {main} main.js, main.js.map (main) 2.16 kB [initial] [rendered]
chunk {polyfills} polyfills.js, polyfills.js.map (polyfills) 722 bytes [initial] [rendered]
chunk {polyfills-es5} polyfills-es5.js, polyfills-es5.js.map (polyfills-es5) 518 kB [initial] [rendered]
chunk {runtime} runtime.js, runtime.js.map (runtime) 6.15 kB [entry] [rendered]
chunk {scripts} scripts.js, scripts.js.map (scripts) 711 kB [entry] [rendered]
chunk {styles} styles.js, styles.js.map (styles) 882 kB [initial] [rendered]
chunk {vendor} vendor.js, vendor.js.map (vendor) 340 kB [initial] [rendered]
Date: 2020-02-15T13:20:57.999Z - Hash: ddcf910bd445ac9ea9a0 - Time: 8343ms
ERROR in Internal Error: Unexpected interpolation
** Angular Live Development Server is listening on localhost:4200, open your browser on http://localhost:4200/ **
这也发生在我身上,我通过更新我的tsconfig来解决它。这使我能够看到阻止构建完成的html错误。这是我修改的
"angularCompilerOptions": {
"fullTemplateTypeCheck": true,
"strictInjectionParameters": true,
"strictTemplates": true
}
更新
在修复了所有明显的html错误后,错误仍然存在,经过广泛的研究,我发现了这一点
问题出在我的html中,我有这样一行:
style="background-image: {{currentuser.profile.photoURL}}"
这通常不是一个好的做法,删除这一行会立即清除错误。如果有人面临同样的问题,我建议退房
就我而言,我只是将上面的一行改为
[style.background-image]="currentuser.profile.photoURL"
在浏览器中打开开发工具时是否有任何错误?如果是这样的话,你能把它们添加到你的问题中吗?升级到v9后,这里也一样,没有任何细节。这里只写了一个错误。不知道是什么问题。如果我使用
ng serve
运行应用程序,我会得到-无法得到