Reputation: 95
I have not been clear what the difference between the two types of syntax is, thank you in advance
Upvotes: 3
Views: 73
Reputation: 155
In addition to @Aravind post this is also the case for @Output
and @ViewChild
directives.
Upvotes: 1
Reputation: 41581
@Input()
will not have any alias naming.
Example
@Input() student:any[];
<component [student]="...">
@Input('someValue')
will take alias as someValue
Example
@Input('studentInfo') student:any[];
<component [studentInfo]="...">
Explanation when you use alias make sure that you are using the alias in the HTML template.
Upvotes: 4