Closed minhson95th closed 3 years ago
You should wrap the ModalDialogParams access:
if (params) {
this.bindData = params.context.data;
this.dataSource = params.context.tab;
this.mode = params.context.mode;
// this.windowId = params.context.windowId
}
You should wrap the ModalDialogParams access:
if (params) { this.bindData = params.context.data; this.dataSource = params.context.tab; this.mode = params.context.mode; // this.windowId = params.context.windowId }
i tried it, still error
ERROR NullInjectorError: StaticInjectorError(AppModule)[FormControlComponent -> ModalDialogParams]:
JS: StaticInjectorError(Platform: core)[FormControlComponent -> ModalDialogParams]:
JS: NullInjectorError: No provider for ModalDialogParams!
if i remove ModalDialogParams, it's can run normally
constructor(
private appService: AppService,
private rqService: RequestService,
private getdulieuservice: GetDuLieuService,
// private params: ModalDialogParams,
) {
// this.bindData = params.context.data;
// this.dataSource = params.context.tab;
// this.mode = params.context.mode;
// this.windowId = params.context.windowId
}
but i can't show modal by showModal
Hey!
Please refer to the angular docs on dependency injection:
https://angular.io/guide/hierarchical-dependency-injection#optional
In this case, since your params
are optional, just use the @Optional
decorator on it.
I want to show component with 2 ways
and
FormControlComponent
but in way 1, when i active viewDetail = true, it's have error
Can i show component FormControlComponent with both ways? use ngIf and use showModal? Thanks