Answers for "for each in enum angular"

1

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);
}
Posted by: Guest on January-11-2021
-1

angular for each

var values = {name: 'misko', gender: 'male'};
var log = [];
angular.forEach(values, function(value, key) {
  this.push(key + ': ' + value);
}, log);
expect(log).toEqual(['name: misko', 'gender: male']);
Posted by: Guest on January-20-2021

Browse Popular Code Answers by Language