Pass Data To Custom Component In Angular 4
I have a custom component with a selector how do i pass data to it in angular 4 to show data in its template. like And in
If "data" variable it's an @Input() property, "data" should be between brackets to allow data binding.
<my-component [data]="shirts"></my-component>
You need to have this in your component:
@Input()data;
Don't forget to import "Input" from @angular/core
Post a Comment for "Pass Data To Custom Component In Angular 4"