-
Notifications
You must be signed in to change notification settings - Fork 24.8k
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
Can't extend IterableDiffers #11309
Comments
Pls expand on what you're trying to do |
As @barbatus said, it's was possible to extend default iterable differs in Components, like here, but now it's not anymore, only available in module providers. @vicb we are using it in As I understand, we moved to use ES6 bundle in the latest version and so we can't access the internal code, so it related to that issue were we asked to export that code for external usage. Thanks! |
Could you please craft a before/after plunker - is this broken in RC6 ? It's true that deep imports are not allowed any more, might be the issue. Thanks |
@vicb Here is a plunker where a custom differ factory is supposed to be used but it throws "Cannot extend IterableDiffers without a parent injector" when I am trying to use As before, we extended standard differs by providing new instance of It's be awesome if you made access to the standard differ factory public (i.e. this one |
@vicb is this scheduled to be resolved in the next maintenance release? There is a growing community looking to use Angular 2.0.0 with Meteor. Based on the latest posts on the corresponding thread, this item is the only one remaining to make the jump. |
@htafolla I'm going to take a look asap. |
just discussed with @vsavkin, we should have a solution by the next release (probably 2.0.1) |
for now a workaround would be not to add the providers in the app module but in a child module. |
@vicb I added it to a module https://plnkr.co/edit/UCKeZGwKfENQY76RHgiy?p=preview, still same exception. I also tried as ModuleWithProviders, also doesn't help. |
@barbatus Adding it as provider to the child component works for me: https://plnkr.co/edit/IZcErDswbe6CLSZOwVve That's also what I did with the METEOR_PROVIDERs to get rid of the exception in my angular2 meteor project. |
@chrisse27 yes, but providers for things like IterableDiffers make sense to set globally for all components not for every one. |
@barbatus I agree, but if I set the provider on my app component then it will be available in all injectors of child components as well. |
@chrisse27 hm, this is how it was before. I thought for some reason they got (or gonna get) rid of providers in components. Anyways makes sense to fix it for modules as well. |
@chrisse27 this also https://angular.io/docs/ts/latest/cookbook/ngmodule-faq.html#!#q-component-or-module. For the apps with routes, there is no one root component as well. |
@barbatus did your solve the issue? |
@DzmitryShylovich I could only work around it. Status of this issue clear states it's not fixed yet. |
@barbatus could u add a small repro in plunkr? |
@DzmitryShylovich ok, there was one above which seems to be broken now. UPD: correct link https://plnkr.co/edit/wV5vrEOStbpH1Vmq1n0B?p=preview |
Ping! What's the status of this @DzmitrySchylovic? |
Differs tries to inject parent differ in order to support extending. This does not work in the 'root' injector as the provider overrides the default injector. The fix is to just assume standard set of providers and extend those instead. PR Close angular#25015 Issue close angular#11309 `Can't extend IterableDiffers` Issue close angular#18554 `IterableDiffers.extend is not AOT compatible` This is fixed because we no longer have an arrow function in the factory but a proper function which can be imported.
Differs tries to inject parent differ in order to support extending. This does not work in the 'root' injector as the provider overrides the default injector. The fix is to just assume standard set of providers and extend those instead. PR Close angular#25015 Issue close angular#11309 `Can't extend IterableDiffers` Issue close angular#18554 `IterableDiffers.extend is not AOT compatible` This is fixed because we no longer have an arrow function in the factory but a proper function which can be imported.
Differs tries to inject parent differ in order to support extending. This does not work in the 'root' injector as the provider overrides the default injector. The fix is to just assume standard set of providers and extend those instead. PR close angular#25015 Issue close angular#11309 `Can't extend IterableDiffers` Issue close angular#18554 `IterableDiffers.extend is not AOT compatible` (This is fixed because we no longer have an arrow function in the factory but a proper function which can be imported.)
Differs tries to inject parent differ in order to support extending. This does not work in the 'root' injector as the provider overrides the default injector. The fix is to just assume standard set of providers and extend those instead. PR close angular#25015 Issue close angular#11309 `Can't extend IterableDiffers` Issue close angular#18554 `IterableDiffers.extend is not AOT compatible` (This is fixed because we no longer have an arrow function in the factory but a proper function which can be imported.)
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
I'm submitting a ... (check one with "x")
Current behavior
Not sure If I am missing something or it's a bug.
But if you do as follows I get "Cannot extend IterableDiffers without a parent injector" exception.
Expected/desired behavior
It's possible to extend default iterable differs in the application module.
Please tell us about your environment:
The text was updated successfully, but these errors were encountered: