Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

iterate over enum angular ngfor

home.component.html
.. 
<tr *ngFor="let rowName of rowNames()">
  <th>{{rowName}}</th>
</tr>

home.component.ts
....
public rowNames(): Array<string> {
    const keys = Object.keys(EventType);
    return keys.slice(keys.length / 2);
}
 
PREVIOUS NEXT
Tagged: #iterate #enum #angular #ngfor
ADD COMMENT
Topic
Name
5+7 =