I custom modal of customModal.ts in shlomiassaf/angular2-modal. Specific, i add a input contain ngModel, it imported FORM_DIRECTIVES and directives.
The issue when run 'No provider for Renderer! (NgModel -> Token NgValueAccessor -> DefaultValueAccessor -> Renderer)'
Please help me resovle this issue. Thanks.
I see two possibilities:
The corresponding provider isn't specified at the component or application level. I don't think that the problem because I already inject a Renderer without having specified it in its providers attribute or within the second parameter of the bootstrap function.
Something like that:
import {Component,Renderer,ElementRef} from 'angular2/core';
@Component({
selector: 'child',
template: '<div></div>',
})
export class ChildComponent {
constructor(private _renderer: Renderer,
private el: ElementRef) {
(...)
}
}
Injectable isn't for be injected into something but for injecting into itself.Edit
After having a look at your code, it seems that you need to add the renderer to the list of providers you provide to the loadNextToLocation method. You could update the code of the DialogService#open method like this:
var otherResolved = Injector.resolve([
provide(DialogRef, { useValue: dialogRef})
provide(Renderer, { useValue: this.renderer})
]);
Hope it helps you, Thierry
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With