I'd like to also add, I only get this error if I bind to the component's 
property with brackets, like this: <my-component 
[myInput]="5"></my-component>
If I don't use brackets, I get no errors, but the value comes in as a 
string, and not a number like I want. 

Can someone please confirm this is happening and I'm not just going crazy?
Create a new app with: ng new test-app
Create a new component with: ng g component foo
Add an input to the component: @Input() public myInput: number;
Implement the component: <app-foo [myInput]="5"></app-foo>
Run tests with: ng test
Confirm test error: "Can't bind to 'myInput' since it isn't a known 
property of 'app-foo'."
Remove brackets and save: <app-foo myInput="5"></app-foo>
Confirm tests run and pass.

I'm not sure if this is an issue with Angular RC5/6/7 or with the CLI. 
Thanks for looking.

On Tuesday, September 13, 2016 at 9:26:12 AM UTC-5, Christopher Collins 
wrote:
>
> Hello. I'm having an issue running my *tests* in RC6 and 7. The app runs 
> perfectly in-browser with no errors, but when I run my tests I get, *"Can't 
> bind to 'myInput' since it isn't a known property of 'my-component'."* 
> "myInput" is defined on the component with "@Input() public myInput: 
> number;". I'm using Angular CLI webpack 8, if that makes any difference. 
> What might cause this? Is there a Karma setting somewhere that I'm missing. 
> Thanks.
>

-- 
You received this message because you are subscribed to the Google Groups 
"AngularJS" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to angular+unsubscr...@googlegroups.com.
To post to this group, send email to angular@googlegroups.com.
Visit this group at https://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.

Reply via email to