Guest User

Untitled

a guest
Nov 16th, 2018
103
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.30 KB | None | 0 0
  1. ngOnInit() {
  2. const factory = this.fr.resolveComponentFactory(HelloComponent);
  3. const ref = this.vcr.createComponent(factory);
  4. ref.instance.name = 'World';
  5.  
  6. setTimeout(() => {
  7. ref.instance.name = 'Netanel';
  8. ref.injector.get(ChangeDetectorRef).markForCheck(); // or detectChanges()
  9. }, 3000);
  10. }
Add Comment
Please, Sign In to add comment