Answer the question
In order to leave comments, you need to log in
Angular 2 initialize nested component before ngOnInit?
Good evening.
Straight to the point.
There is a main component that implements OnInit, in which the server is called, and the resulting data array is written to the component's products variable. Seems clear and crisp.
main has markup like:
...
<product [data]="products[0]"></product>
<div class="small">
<product class="small_product" *ngFor="let index of [1, 2]" [data]="products[index]"></product>
</div>
...
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question