Answer the question
In order to leave comments, you need to log in
How is @Input passed to the directive?
Please help me understand how a variable is passed to the directive.
The fact is that the template looks like this:@Input() appNgLoopOf: Array<any>;
<div *appNgLoop="let nr of numbers; index as i">
{{ nr }} - Foo
Index: {{ i }}
</div>
Answer the question
In order to leave comments, you need to log in
The asterisk unfolds your loop like this
<div appNgLoop let-ng="$implicit" [appNgLoopOf]="numbers" let-i="index">
{{ nr }} - Foo
Index: {{ i }}
</div>
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question