Skip to content

Commit

Permalink
[hotfix][runtime-web] explicitly markForCheck OnPush dynamic componen…
Browse files Browse the repository at this point in the history
…t using injector
  • Loading branch information
yangjunhan authored and zhuzhurk committed Aug 2, 2022
1 parent 57990c3 commit cb2f724
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@ import {
Type,
OnChanges,
SimpleChanges,
ComponentRef
ComponentRef,
ChangeDetectorRef
} from '@angular/core';

import { DynamicDirective } from '@flink-runtime-web/share/common/dynamic/dynamic.directive';
Expand Down Expand Up @@ -56,6 +57,9 @@ export class DynamicHostComponent implements OnChanges {
Object.keys(this.data).forEach(k => {
instance[k] = this.data[k];
});
// https://github.com/angular/angular/issues/36667
// OnPush dynamic component never refresh by ComponentRef.changeDetectorRef
this.componentRef!.injector.get(ChangeDetectorRef).markForCheck();
}
}
}
Expand Down

0 comments on commit cb2f724

Please sign in to comment.