Html &引用;让我们来看看;仅在ng模板元素上受支持
我正试图让我的前端应用程序(Angular5.1.x)运行,但由于模板分析错误,它停止了:Html &引用;让我们来看看;仅在ng模板元素上受支持,html,angular,npm,frontend,ngx-bootstrap,Html,Angular,Npm,Frontend,Ngx Bootstrap,我正试图让我的前端应用程序(Angular5.1.x)运行,但由于模板分析错误,它停止了: "let-" is only supported on ng-template elements. (" </thead> <tbody> <template ngFor [ngForOf]="rows" [ERROR ->]let-rowz="$implicit" let- index="index"> <tr *ngIf="!(datePicker
"let-" is only supported on ng-template elements. ("
</thead>
<tbody>
<template ngFor [ngForOf]="rows" [ERROR ->]let-rowz="$implicit" let- index="index">
<tr *ngIf="!(datePicker.onlyCurrentMonth && rowz[0].sec"):
ng:///DatepickerModule/DayPickerComponent.html@52:58
at syntaxError (compiler.js:485)
at TemplateParser.parse (compiler.js:24633)
at JitCompiler._parseTemplate (compiler.js:34442)
at JitCompiler._compileTemplate (compiler.js:34417)
at compiler.js:34318
at Set.forEach (<anonymous>)
at JitCompiler._compileComponents (compiler.js:34318)
at compiler.js:34188
at Object.then (compiler.js:474)
at JitCompiler._compileModuleAndComponents (compiler.js:34187)
“let-”仅在ng模板元素上受支持。("
]let rowz=“$implicit”let-index=“index”>
v2+中没有
标记,请进行清洁安装,
并检查您是否有ngx引导v2+
使用
在angular 5.x.x
中已弃用的
检查包锁(如果存在)。ngx引导1.x.x
。因此您必须升级到ngx引导2.x.x
执行以下操作以升级
npm uninstall --save ngx-bootstrap
npm cache clean -f
npm install --save ngx-bootstrap
从Angular 4.x.x升级到5.x.x时遇到此错误。原始代码为:
<template let-item>
</template>
我面临同样的问题,在html文件中用
替换
标记,我解决了这个问题。它也面临同样的问题。通过这个问题,我发现我创建的数组是
<ng-template ngFor [ngForOf]="names" let-name="$implicit" let-i="index">
<div><span>{{i+1}}</span> <span> {{name.name}}</span></div>
</ng-template>
然后,我将其替换为:-
names:Array<any>= [{id:1,name:'shashikant'},{id:2,name:'Rakesh'},{id:3,name:'Umesh'}];
names:Array=[{id:1,name:'shashikant'},{id:2,name:'Rakesh'},{id:3,name:'Umesh'}];
指定了数组的类型只需搜索全部
您在html文件中不使用ng模板标记,但已将ngx模块导入到app.model.ts
然后这将出现。删除你的app.model导入语句并生成并检查
谢谢。为什么你不能写ng模板而不是模板?模板不推荐使用,你应该使用ng-template。谢谢你的反馈valorkin,最后我不得不做一个“npm缓存清除-强制”来工作。我删除了我的节点模块,做了npm缓存清除-强制
,我仍然有这个问题。使用“ngx引导程序“^2.0.2”
,“ngx日期选择器”:“0.0.24”“
。删除package lock json文件并再次执行。我尝试过,但仍然出现此错误。我创建了一个新的节点项目,并导入了ngx日期选择器。版本号为0.0.24。其中有几个模板
标记。您可能需要将其设置为#let-itemsawesome。谢谢。
names= [{id:1,name:'shashikant'},{id:2,name:'Rakesh'},{id:3,name:'Umesh'}];
names:Array<any>= [{id:1,name:'shashikant'},{id:2,name:'Rakesh'},{id:3,name:'Umesh'}];