Answer the question
In order to leave comments, you need to log in
How to access an array of elements in Angular?
there is such a code
<div *ngFor="let text of items ">
<a class="link_color" href="">{{text .item}}</a>
</div>
Answer the question
In order to leave comments, you need to log in
You can get confused and assign an ID to the diva, then get its inner html directly in the controller, but this approach is fundamentally wrong.
You have an array of items, through it and exercise control, add the necessary properties. And already through these properties influence html. For example, add a color property and write like this:
<a [ngClass]="text .color" href="">{{text .item}}</a>
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question