Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Angular 4 <template> warning #98

Closed
infinitysky opened this issue Mar 16, 2017 · 4 comments
Closed

Angular 4 <template> warning #98

infinitysky opened this issue Mar 16, 2017 · 4 comments

Comments

@infinitysky
Copy link

infinitysky commented Mar 16, 2017

Hi all,
I just upgraded my project from Angular 2 to Angular 4. After I start my project, I received a warning message about the .

Template parse warnings:
The <template> element is deprecated. Use <ng-template> instead ("!option.isLabel && setSelected($event, option)" [class.dropdown-header]="option.isLabel">
          [ERROR ->]<template [ngIf]="option.isLabel">
            {{ option.name }}
          </template>
"): MultiselectDropdown@36:10

I checked the source code. Just edit the line No. 126 and change the <

<template [ngIf]="option.isLabel">
            {{ option.name }}
 </template>>

to

 <ng-templat [ngIf]="option.isLabel">
            {{ option.name }}
  </ng-templat >

Then, the warning will disappear.

@softsimon
Copy link
Owner

softsimon commented Mar 16, 2017

I am aware of this. But Angular 2 is the latest stable release which the majority is using, and changing to <ng-template will lead to build fail for 2.x users. Not until 4.0 is released stable and people have upgraded this fix can be made.

See #84

@jiayihu
Copy link

jiayihu commented Mar 29, 2017

Actually @softsimon it has been introduced in latest AOT commit at this line and now I'm receiving errors because I'm using Angular 2.X

@softsimon
Copy link
Owner

I am not sure how to handle this issue correctly. Support 2.x with deprecated warning for 4.x users or require 4.x? It would be unnecessary hassle with two branches.

@jiayihu
Copy link

jiayihu commented Mar 29, 2017

I think since Angular 4 is just release as stable this lib should continue to support 2.x for a while and 4.x users will see a warning. ng-bootstrap is doing the same.

The problem with requiring 4.x is that then 2.x users won't be able to use the lib because the application will throw instead of just logging a warning.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants