New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.
Already on GitHub? Sign in to your account
not really clear that inputs can ONLY be assigned using props :/ #567
Comments
You can also assign an input with Your
If you do as above, you're initializing the component, and having the issue because component.task is undefined during this step. The task would be set only after that, once it's too late An other way is to play with the detectChanges property, but it has other impacts
So, your issue is specific to your usecase. Using |
In addition to the above, you can also wrap your component with a HostComponent using the |
Is this a regression?
No
Description
I tried to use Spectator as a drop-in replacement for a component unit-test and after re-writing the
TestBed
toSpectator
s tinier boilerplate 馃帄 I could not get past this error:that I got because I kept the original @input assignment, in my
beforeEach()
afterspectator = createComponent()
:This does not work, you need to use the
props
property ofcreateComponent()
to assign @inputs.I think this needs to be clarified better in the docs.
The error given is not descriptive: It emanates from compiled component javascript, and not the spec file, so my immediate reaction was to change the only line of code in the component containing the word
id
:to see if this is what was causing the error, but it was not.
Please provide a link to a minimal reproduction of the bug
N/A
Please provide the exception or error you saw
Please provide the environment you discovered this bug in
Anything else?
fixed by using props:
Do you want to create a pull request?
Yes
The text was updated successfully, but these errors were encountered: