Replies: 3 comments
-
Can you share the component code, please? |
Beta Was this translation helpful? Give feedback.
0 replies
-
OK but don't steal it from it to become rich, eh? :-D
|
Beta Was this translation helpful? Give feedback.
0 replies
-
I see. This is because when calling setInput it'll run change detection on the component and not on the host. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Description
Hello,
I'm currently testing a very simple component that applies on a "button" to style it and add some capabilities.
This component uses the OnPush change strategy, so I have a test like this:
It works well but I was wondering why I had to call "detectChanges" after every "setInput". If I'm not mistaken, Angular performs a digest cycle when an input is updated, so shouldn't spectator do the same?
Proposed solution
Call
detectChanges
fromsetInput
Alternatives considered
None
Do you want to create a pull request?
No
Beta Was this translation helpful? Give feedback.
All reactions