Replies: 6 comments 6 replies
-
You need to call detectChanges() |
Beta Was this translation helpful? Give feedback.
-
Why are u close problem? dom-spectator.ts:
Unfortunately, you use root in
Why use different instances of DC? |
Beta Was this translation helpful? Give feedback.
-
It's an Angular design. When you call detectChanges it will call ngOnInit. This is not a Spectator issue. That's why I closed it. |
Beta Was this translation helpful? Give feedback.
-
Yes, of couse, DC trigger hooks. |
Beta Was this translation helpful? Give feedback.
-
I push PR, 1 test down.
Interesting test example. |
Beta Was this translation helpful? Give feedback.
-
I'm undestand why used manual |
Beta Was this translation helpful? Give feedback.
-
ngOnInit
,ngAfterViewInit
and other hooks not called when usecreateComponentFactory
+detectChanges = false
+setInput
I'm submitting a...
Current behavior
ngOnInit
,ngAfterViewInit
and other hooks not calledExpected behavior
ngOnInit
,ngAfterViewInit
and other hooks calledMinimal reproduction of the problem with instructions
https://stackblitz.com/edit/angular-testing-senb4a?file=app%2Fapp.component.spec.ts
Environment
Beta Was this translation helpful? Give feedback.
All reactions