I have a model like this:
export class Person{
name: string;
}
Which is used in my component as follow:
export class TestComponent {
@Input() person : Person;
constructor() {
}
}
I want to set person name from html as below:
<app-test [person.name]="'Jack'"</app-test>
When I do so, angular gets angry that : "Can't bind to 'person.name' since it isn't a known property of 'app-test'."
well, he is right somehow, person is property of my component, not person.name
On the other hand, we don't get any error in following sample:
<span [style.color]="'red'">This span is red.</span>
Am I moving against rules??
Or is style property internally different? How?
Thanks