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

alpha.18 datepicker is incompatible with Angular 4.0.0-beta.2 #1202

Closed
alanpurple opened this issue Jan 10, 2017 · 8 comments
Closed

alpha.18 datepicker is incompatible with Angular 4.0.0-beta.2 #1202

alanpurple opened this issue Jan 10, 2017 · 8 comments

Comments

@alanpurple
Copy link

alanpurple commented Jan 10, 2017

http://plnkr.co/edit/QnqHUryS3vlu24FwrZoL?p=preview

@pkozlowski-opensource
Copy link
Member

@alanpurple I'm not sure what is exactly "not working" based on the attached plunker (or rather, what is the problem with material).

In the plunker I can see an error thrown when the model is undefined. This happens in Angular 4.0.x only and it seems like this is a breaking change on the Angular side. I'm going to confirm with the core team if this change was intentional or not (and if it was intentional we are going to fix it here). Is this what you are reporting here?

@alanpurple
Copy link
Author

alanpurple commented Jan 10, 2017

@pkozlowski-opensource
those errors are not thrown without angular-material, even with angular 4.0.0

@pkozlowski-opensource
Copy link
Member

those errors are not thrown without angular-material, even with angular 4.0.0

@alanpurple are you sure? Asking since I've got a plunk that suggest otherwise: http://plnkr.co/edit/dPJ4QsRPsX6ZLtfXrEdl?p=preview (errors thrown even if material not used)

@alanpurple
Copy link
Author

@pkozlowski-opensource
ok, that, I never seen in my analysis

my bad, sorry

@pkozlowski-opensource
Copy link
Member

@maxokorokov there is indeed change from 2.x.y to 4.x.y in the way changes are delivered (see http://plnkr.co/edit/cyWm42UGEaJaaeDK95Eh?p=preview).

Having said this currentValue is undefined in both cases so I'm not sure how it can work in 2.4.2....

@pkozlowski-opensource
Copy link
Member

pkozlowski-opensource commented Jan 10, 2017

This is the reference to the Angular commit that (most probably) breaks things for us: angular/angular@465516b

Funnily enough it says in the changelog:

SimpleChange now takes an additional argument that defines whether this is the first change or not. This is a low profile API and we don't expect anyone to be affected by this change. If you are impacted by this change please file an issue.

It would be good to dig to the bottom of it and eventually open an issue on the Angular side.

@pkozlowski-opensource pkozlowski-opensource changed the title alpha.18 datepicker is incompatible with angular-material alpha.18 datepicker is incompatible with Angular 4.0.0-beta.2 Jan 10, 2017
@pkozlowski-opensource pkozlowski-opensource added this to the 1.0.0-alpha.19 milestone Jan 13, 2017
@ValentinFunk
Copy link

I was going to open a new bug report but it seems it's the same issue as this. Getting the same error if using 4.0.0-beta.3 with the Datepicker popup.

Details:

Bug description:

When using the Datepicker in a popup, it does not work when using model driven forms (i.e. FormGroup, FormBuilder) instead of ngModel. It seems that in ngOnChanges previousValue is accessed even if firstChange is set to true.

Error:

TypeError: Cannot read property 'year' of undefined
    at NgbDatepickerNavigationSelect.ngOnChanges (VM1176 ng-bootstrap.js:3250)
    at proxyClass.Wrapper_NgbDatepickerNavigationSelect.ngDoCheck (VM3407 wrapper.ngfactory.js:64)
    at View_NgbDatepickerNavigation_1.detectChangesInternal (VM3435 component.ngfactory.js:58)
    at View_NgbDatepickerNavigation_1.AppView.detectChanges (VM3490 core.umd.js:12718)
    at View_NgbDatepickerNavigation_1.DebugAppView.detectChanges (VM3490 core.umd.js:12864)
    at ViewContainer.detectChangesInNestedViews (VM3490 core.umd.js:12975)
    at proxyClass.View_NgbDatepickerNavigation_0.detectChangesInternal (VM3435 component.ngfactory.js:192)
    at proxyClass.AppView.detectChanges (VM3490 core.umd.js:12718)
    at proxyClass.DebugAppView.detectChanges (VM3490 core.umd.js:12864)
    at proxyClass.AppView.internalDetectChanges (VM3490 core.umd.js:12702)

Link to minimally-working plunker that reproduces the issue:

http://plnkr.co/edit/7z6zTDbYPHUQHO8SmTUR?p=preview

Version of Angular, UIBS, and Bootstrap

Angular: 4.0.0-beta.3

UIBS: 1.0.0-alpha.18

Bootstrap: 4.0.0-alpha.6

@pkozlowski-opensource
Copy link
Member

I've discussed this breaking change with the rest of the Angular team and:

  • yes, this is a breaking change;
  • it is unlikely that it is going to get reverted.

As the result we are going to work-around it here. A fix should land in the next release.

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

No branches or pull requests

3 participants