0

I am trying to open nebular dialog by ngrx effect. It works, but not the first time.

First time appears error:

"ERROR TypeError: Cannot read property 'appendChild' of null"

If refresh page and the open dialog it opens

action.ts:

export const loadModal = createAction('[Products] Load Replenish Invoice Modal', props<{ payload: string }>());

effect.ts

loadModal$ = createEffect(
    () =>
      this.actions$.pipe(
        ofType(ProductsActions.loadModal),
        tap(action => {
          console.log(action);
          this.dialogService.open(ProductConfirmModalComponent, {});
        }),
      ),
    { dispatch: false },
  );

Here is my component where I am dispatching action:

ngOnInit() {
 this.sub = this.route.queryParams.subscribe(params => {
      this.store.dispatch(loadCurrencies({ payload: params.type }));
    });
}
4

1 回答 1

0

看起来问题指的是<nb-layout>,你能提供一个stackblitz exmaple吗?

于 2020-01-20T12:01:40.617 回答