In parent component template:
<parent1>
<child1 [count] = "2"></child1>
</parent>
And in child component access that input like this:
import { Component,Input,OnInit } from '@angular/core';
@Component({
selector: 'child1',
template: `<
<ul>
<li *ngFor = let n of Count">
<child 2> </child2>
</li>
</ul>
`
})
export class AppChildComponent implements OnInit{
@Input() Count: int ;
constructor(){
}
ngOnInit(){
}
}
--
You received this message because you are subscribed to the Google Groups
"Angular and AngularJS discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/angular.
To view this discussion on the web visit
https://groups.google.com/d/msgid/angular/30ca17f1-2829-4419-a5dd-fe8a0aa4441c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.