Answer the question
In order to leave comments, you need to log in
How to write such a condition correctly (angular2)?
There is data:
this.users = [{
name: 'username',
category: 'category'
}]
<div class="user" *ngFor="#user of users"><img src="img/icon.png" alt="">{{user.name}}</div>
Answer the question
In order to leave comments, you need to log in
I recommend adding the path to the icon at the data source level, or in the controller. This case can then be easily covered by tests, without the need to instantiate the UI element.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question