I am trying to get my frontend-application(Angular5.1.x) to run but it stops due to template parse error:
"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)
I figured I need to follow this on-topic issue, stating I need to use ngx-bootrap@[email protected], but it doesnt work with that or v.2.0.0-rc.0
https://github.com/valor-software/ngx-bootstrap/issues/3024
...any help is appreciated
ng-template is an Angular element that is used for rendering HTML in a template. However, it is not rendered directly on DOM. If you include an ng-template tag to a template, the tag and the content inside it will be replaced by comment upon render.
Passing data to ngTemplateOutletWe can also pass data to the using its second property ngTemplateOutletContext . Alternatively you can also use the following syntax. Pass more than one value. Pass an object.
Structural Directiveslink One of the main uses for <ng-template> is to hold template content that will be used by Structural directives.
I have encountered this error when upgraded from Angular 4.x.x to 5.x.x. Original code was:
<template let-item>
</template>
This worked fine in Angular 4, but failed in 5. Simply using ng-template
worked correctly (no packages installation was required, no cache clean required):
<ng-template let-item>
</ng-template>
ngx-bootstrap 1.x.x
using <template>
which has been deprecated in angular 5.x.x
. so you have to upgrade to ngx-bootstrap 2.X.X
Do following to upgrade
npm uninstall --save ngx-bootstrap
npm cache clean -f
npm install --save ngx-bootstrap
there are no <template>
tags in v2+, please do clean install,
and check that you have ngx-bootstrap v2+
check package lock if present
Just search all
<template
and replace with <ng-template
</template>
and replace with </ng-template>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With