Javascript 运行Angular app时出错:“0”;让我们来看看;仅在ng模板元素上受支持
我将所有包更新为Angular 5,但当我尝试获取Javascript 运行Angular app时出错:“0”;让我们来看看;仅在ng模板元素上受支持,javascript,angular,webpack,Javascript,Angular,Webpack,我将所有包更新为Angular 5,但当我尝试获取localhost:4200 在控制台中,我有一个错误: Uncaught Error: Template parse errors: "let-" is only supported on ng-template elements. ("<template #innerView></template> <template #template [ERROR ->]let-ctx> <
localhost:4200
在控制台中,我有一个错误:
Uncaught Error: Template parse errors:
"let-" is only supported on ng-template elements. ("<template #innerView></template>
<template #template [ERROR ->]let-ctx>
<template [swapCmp]="ctx.component" [swapCmpBindings]="ctx.bindings" [swapCmpProjectable"): ng:///ModalModule/ModalOverlay.html@1:20
at syntaxError (webpack-internal:///./node_modules/@angular/compiler/esm5/compiler.js:684)
at TemplateParser.parse (webpack-internal:///./node_modules/@angular/compiler/esm5/compiler.js:24530)
at JitCompiler._parseTemplate (webpack-internal:///./node_modules/@angular/compiler/esm5/compiler.js:33917)
at JitCompiler._compileTemplate (webpack-internal:///./node_modules/@angular/compiler/esm5/compiler.js:33892)
at eval (webpack-internal:///./node_modules/@angular/compiler/esm5/compiler.js:33794)
at Set.forEach (<anonymous>)
at JitCompiler._compileComponents (webpack-internal:///./node_modules/@angular/compiler/esm5/compiler.js:33794)
at eval (webpack-internal:///./node_modules/@angular/compiler/esm5/compiler.js:33664)
at Object.then (webpack-internal:///./node_modules/@angular/compiler/esm5/compiler.js:673)
at JitCompiler._compileModuleAndComponents (webpack-internal:///./node_modules/@angular/compiler/esm5/compiler.js:33663)
未捕获错误:模板分析错误:
“let-”仅在ng模板元素上受支持。("
]让ctx>
错误清楚地表明,“让-"仅在ng模板元素上受支持。
因此,如果您在任何其他元素中使用let
而不是ng模板
,则会出现此错误。如果您正在使用let-in模板
,请将模板
元素更改为Angular-5
ng模板
呈角度4
尝试使用template
而不是ng template
对我来说,帮助是卸载angular2-modal
并安装ngx modialog
,然后在项目中更改软件包。您是否使用
而不是
?角度版本没有问题,代码有问题您修改过polyfill吗s、 有什么问题吗?我应该把html上的模板
改成ng模板
。@hardprobler确切地说@Ramesh Rajendran not helpedYes对我来说,帮助是卸载angular2-modal并安装ngx modialog,然后在project中更改软件包。@hardprobler您能在您的问题中更新您的html代码吗?