Answer the question
In order to leave comments, you need to log in
How to compare the data and display the result?
An object comes to me from the database, conditionally:
obj = {
action: 'meet'
}
PanelControl: Array<Object> = [
{action: 'call', translate: 'Звонок'},
{action: 'meet', translate: 'Встреча'},
{action: 'task', translate: 'Задача'},
];
<div class="wrapp" *ngFor='let x of obj'>
<span>{{x.action}}</span>
</div>
Answer the question
In order to leave comments, you need to log in
В Angular 6.1 был KeyValuePipe, который позволяет выполнять итерацию свойств объекта:
<div *ngFor="let x of object | obj">
{{x.key}}:{{x.value}}
</div>
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question