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 5 support for 1.x version #3039

Closed
FrancescoBorzi opened this issue Nov 14, 2017 · 13 comments
Closed

Angular 5 support for 1.x version #3039

FrancescoBorzi opened this issue Nov 14, 2017 · 13 comments

Comments

@FrancescoBorzi
Copy link
Member

FrancescoBorzi commented Nov 14, 2017

I understand the 2.x beta version already supports Angular 5, however there are a few breaking changes between version 1.x and 2.x and we are stuck because we can't use Angular 5 before migrating our codebase to ngx-bootstrap 2.x.

Since there is not yet an official doc that explains how to correctly migrate to version 2.x (see #3022), and since I assume that there are no that many things to change in 1.x to get it working with Angular 5 (afaik it's just some <template> that needs to be replaced with <ng-template>), it would be nice if we can have a 1.10.x version with no breaking changes that works out of the box using Angular 5.

@Zeemee7
Copy link

Zeemee7 commented Nov 15, 2017

That would be great indeed. Got this error after upgrading to Angular 5:

Uncaught Error: Template parse errors:
"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:37
"let-" is only supported on ng-template elements. ("
  </thead>
  <tbody>
    <template ngFor [ngForOf]="rows" let-rowz="$implicit" [ERROR ->]let-index="index">
      <tr *ngIf="!(datePicker.onlyCurrentMonth && rowz[0].secondary && rowz[6].sec"): ng:///DatepickerModule/DayPickerComponent.html@52:58
    at syntaxError (vendor.bundle.js:164254)
    at TemplateParser.webpackJsonp.../../../compiler/esm5/compiler.js.TemplateParser.parse (vendor.bundle.js:188102)
    at JitCompiler.webpackJsonp.../../../compiler/esm5/compiler.js.JitCompiler._parseTemplate (vendor.bundle.js:197489)
    at JitCompiler.webpackJsonp.../../../compiler/esm5/compiler.js.JitCompiler._compileTemplate (vendor.bundle.js:197464)
    at vendor.bundle.js:197366
    at Set.forEach (<anonymous>)
    at JitCompiler.webpackJsonp.../../../compiler/esm5/compiler.js.JitCompiler._compileComponents (vendor.bundle.js:197366)
    at vendor.bundle.js:197236
    at Object.then (vendor.bundle.js:164243)
    at JitCompiler.webpackJsonp.../../../compiler/esm5/compiler.js.JitCompiler._compileModuleAndComponents (vendor.bundle.js:197235)

@FrancescoBorzi
Copy link
Member Author

@Zeemee7 yes this is related with the usage of <template> in version 1.x which should be replaced with <ng-template>

@IlyaSurmay
Copy link
Contributor

What exactly is stopping you from updating? Breaking changes are listed here. Let us know if there's something we didn't mention.

@FrancescoBorzi
Copy link
Member Author

as I was saying on slack, in our case we have a page with a form containing 2 instances of Datepicker and 2 instances of Timepicker. Using version 2.x that form is broken, I quickly tried to adapt it to the new version but without success.

I will, however, spend more time on it and eventually use the 2.x version. But I guess it's quicker to build a 1.10.x version having all <template> replaced with <ng-template> so we can already use Angular 5.

@FrancescoBorzi
Copy link
Member Author

FrancescoBorzi commented Nov 16, 2017

@IlyaSurmay @valorkin those are some of the errors that I get in that page when I use ngx-bootstrap 2.x:

image

( the same page works fine with ngx-bootstrap 1.9.x )

I tried to solve them and new ones popped... then tried to solve them too and again got no errors... That's why I decided to postpone the migration to ngx-bootstrap 2.x a little bit.

@valorkin
Copy link
Member

  1. adding support of ng v5 requires drop support of ng v2, it's breaking changing
    and requires major version bump
  2. v2 of ngx-bs is adding support of ng v5

@valorkin
Copy link
Member

so basically this is what we already did and continue to work on it

@rakhtar92
Copy link

I have ngx-bootstrap ^2.0.0-beta.8, but still I am getting the same error.
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 (compiler.js:485) at TemplateParser.webpackJsonp../node_modules/@angular/compiler/esm5/compiler.js.TemplateParser.parse (compiler.js:24668) at JitCompiler.webpackJsonp../node_modules/@angular/compiler/esm5/compiler.js.JitCompiler._parseTemplate (compiler.js:34621) at JitCompiler.webpackJsonp../node_modules/@angular/compiler/esm5/compiler.js.JitCompiler._compileTemplate (compiler.js:34596) at compiler.js:34497 at Set.forEach (<anonymous>) at JitCompiler.webpackJsonp../node_modules/@angular/compiler/esm5/compiler.js.JitCompiler._compileComponents (compiler.js:34497) at compiler.js:34367 at Object.then (compiler.js:474) at JitCompiler.webpackJsonp../node_modules/@angular/compiler/esm5/compiler.js.JitCompiler._compileModuleAndComponents (compiler.js:34366)

@FrancescoBorzi
Copy link
Member Author

@rakhtar92 this is not related with this issue. If you're already using version 2.x, why on earth are you still sticking to beta8 instead of using latest stable release 2.0.2 ?

@syongxin
Copy link

@ShinDarth Is this issue fixed? I'm using 2.0.3 and still getting the same error.

ng:///ModalModule/ModalOverlay.html@1:20

@FrancescoBorzi
Copy link
Member Author

I'm now using also 2.0.3 and everything looks fine to me

@andfs
Copy link

andfs commented Apr 2, 2018

@ShinDarth Have you found a solution?

@FrancescoBorzi
Copy link
Member Author

@andfs as I said, I'm now using latest Angular and ngx-bootstrap versions and everything works fine. I suggest you to do the same.

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

7 participants