primeng icon indicating copy to clipboard operation
primeng copied to clipboard

'ng-template' is not a known element:

Open skorunka opened this issue 9 years ago • 13 comments

After adding FileUpload I got this runtime error: image

Other components(radio, checkbox) work fine.

My project is based on https://github.com/aspnet/JavaScriptServices/tree/dev/templates/Angular2Spa

In webpack(webpack.config.vendor.js) I'm referencing these dependencies: 'primeng/components/fileupload/fileupload', 'primeng/components/fileupload/fileupload.css',

And FileUploadModuleis registered in app.module.ts.

Any ideas?

skorunka avatar Mar 17 '17 11:03 skorunka

"PrimeNG 4 requires Angular 4, if you are on Angular 2 use PrimeNG 2.0.x instead."

After downgrading to 2.0.x, problem sorted.

skorunka avatar Mar 17 '17 11:03 skorunka

I am getting the below error.

'ng-template' is not a known element:

package.json

"primeng": "^2.0.4", "@angular/core": "^2.4.0",

app.module.ts

Imported the below modules DataTableModule, SharedModule

Looks like its unable to find the module in which the "ng-template" directive is present. Please help.

balajiswaroop avatar Mar 20 '17 09:03 balajiswaroop

got the same error - my html is -- <p-pickList [source]="sourceCars" [target]="targetCars" sourceHeader="Available" targetHeader="Selected" [responsive]="true" [sourceStyle]="{'height':'300px'}" [targetStyle]="{'height':'300px'}">

{{car.brand}} - {{car.year}} - {{car.color}}


component-ts -just the 2 lists initialised with data


App.Module import {PickListModule, ConfirmDialogModule, SharedModule} from from 'primeng/primeng'; @NgModule({ imports: [PickListModule, ConfirmDialogModule, SharedModule]

But for me my other code with DataTableModule works fine

anubhavNPA avatar Mar 20 '17 22:03 anubhavNPA

@balajiswaroop

I am getting the below error. 'ng-template' is not a known element:

I had exactly the same problem today on "primeng": "^2.0.4", "@angular/core": "2.4.9",

found a solution: use 'template' instead of 'ng-template' in your html template.

I think that errors appears because of version, that is ng-template added only in Angular 4 core.

AKorshunov87 avatar Mar 21 '17 19:03 AKorshunov87

using template tag works just fine, thanks a lot @AKorshunov87

mkwsra avatar Mar 22 '17 20:03 mkwsra

ng-template is Angular4 only, you need to target primeng version which is build for Angular2

skorunka avatar Mar 23 '17 08:03 skorunka

template worked for me too. Thanks!

MakhouT avatar Mar 24 '17 11:03 MakhouT

template worked for me too. Thank you!!

GIOkafor avatar Mar 28 '17 14:03 GIOkafor

template work for me too !! just find mutliselect-dropdown.ts replace ng-template with template

TarsemKashyap avatar Apr 01 '17 11:04 TarsemKashyap

I'm getting the same error..but I couldn't find where to replace the ng-template to just template. Help plz...

lucky9abhi avatar Apr 15 '17 18:04 lucky9abhi

@lucky9abhi you can find this file "mutliselect-dropdown.ts" inside node_modules folder with package name you installed.

TarsemKashyap avatar Apr 16 '17 03:04 TarsemKashyap

use only template is work fine . thank you

usshweoo avatar Sep 13 '17 05:09 usshweoo

i'm getting same error, when using p-picklist in ngprime, can you please tell me how to use "template" insted of "ng-template"?

i'm getting error:

zone.js:522 Unhandled Promise rejection: Template parse errors: "let-" is only supported on template elements. ("gleave)="onListDragLeave()" (drop)="onListDrop($event, -1)"> <ng-template ngFor [ERROR ->]let-item [ngForOf]="source" let-i="index" let-l="last"> <li class="ui-picklis"): PickList@17:39 "let-" is only supported on template elements. ("(drop)="onListDrop($event, -1)"> <ng-template ngFor let-item [ngForOf]="source" [ERROR ->]let-i="index" let-l="last"> <li class="ui-picklist-droppoint" *ngIf="dragdrop"): PickList@17:67 "let-" is only supported on template elements. ("Drop($event, -1)"> <ng-template ngFor let-item [ngForOf]="source" let-i="index" [ERROR ->]let-l="last"> <li class="ui-picklist-droppoint" *ngIf="dragdrop" (dragover)=""): PickList@17:81 Can't bind to 'ngTemplateOutletContext' since it isn't a known property of 'ng-container'.

  1. If 'ng-container' is an Angular component and it has 'ngTemplateOutletContext' input, then verify that it is part of this module.
  2. If 'ng-container' is a Web Component then add "CUSTOM_ELEMENTS_SCHEMA" to the '@NgModule.schemas' of this component to suppress this message. ("nDragStart($event, i, -1)" (dragend)="onDragEnd($event)"> <ng-container [ERROR ->]*ngTemplateOutlet="itemTemplate; context: {$implicit: item, index: i}"> "): PickList@24:42 Property binding ngTemplateOutletContext not used by any directive on an embedded template. Make sure that the property name is spelled correctly and all directives are listed in the "@NgModule.declarations". ("(dragstart)="onDragStart($event, i, -1)" (dragend)="onDragEnd($event)"> [ERROR ->]<ng-container *ngTemplateOutlet="itemTemplate; context: {$implicit: item, index: i}"> "): PickList@24:28 'ng-template' is not a known element:
  3. If 'ng-template' is an Angular component, then verify that it is part of this module.
  4. If 'ng-template' is a Web Component then add "CUSTOM_ELEMENTS_SCHEMA" to the '@NgModule.schemas' of this component to suppress this message. ("ve($event,-1)" (dragleave)="onListDragLeave()" (drop)="onListDrop($event, -1)"> [ERROR ->]<ng-template ngFor let-item [ngForOf]="source" let-i="index" let-l="last"> <l"): PickList@17:20 "let-" is only supported on template elements. ("ragleave)="onListDragLeave()" (drop)="onListDrop($event,1)"> <ng-template ngFor [ERROR ->]let-item [ngForOf]="target" let-i="index" let-l="last"> <li class="ui-picklis"): PickList@46:39 "let-" is only supported on template elements. ("" (drop)="onListDrop($event,1)"> <ng-template ngFor let-item [ngForOf]="target" [ERROR ->]let-i="index" let-l="last"> <li class="ui-picklist-droppoint" *ngIf="dragdrop"): PickList@46:67 "let-" is only supported on template elements. ("stDrop($event,1)"> <ng-template ngFor let-item [ngForOf]="target" let-i="index" [ERROR ->]let-l="last"> <li class="ui-picklist-droppoint" *ngIf="dragdrop" (dragover)=""): PickList@46:81 Can't bind to 'ngTemplateOutletContext' since it isn't a known property of 'ng-container'.
  5. If 'ng-container' is an Angular component and it has 'ngTemplateOutletContext' input, then verify that it is part of this module.
  6. If 'ng-container' is a Web Component then add "CUSTOM_ELEMENTS_SCHEMA" to the '@NgModule.schemas' of this component to suppress this message. ("onDragStart($event, i, 1)" (dragend)="onDragEnd($event)"> <ng-container [ERROR ->]*ngTemplateOutlet="itemTemplate; context: {$implicit: item, index: i}"> "): PickList@53:42 Property binding ngTemplateOutletContext not used by any directive on an embedded template. Make sure that the property name is spelled correctly and all directives are listed in the "@NgModule.declarations". (" (dragstart)="onDragStart($event, i, 1)" (dragend)="onDragEnd($event)"> [ERROR ->]<ng-container *ngTemplateOutlet="itemTemplate; context: {$implicit: item, index: i}"> "): PickList@53:28 'ng-template' is not a known element:
  7. If 'ng-template' is an Angular component, then verify that it is part of this module.
  8. If 'ng-template' is a Web Component then add "CUSTOM_ELEMENTS_SCHEMA" to the '@NgModule.schemas' of this component to suppress this message. ("eMove($event,1)" (dragleave)="onListDragLeave()" (drop)="onListDrop($event,1)"> [ERROR ->]<ng-template ngFor let-item [ngForOf]="target" let-i="index" let-l="last"> <l"): PickList@46:20 ; Zone: ; Task: Promise.then ; Value: SyntaxError Error:

Mohanr1122 avatar Apr 17 '18 11:04 Mohanr1122