Is there a way to iterate over the properties of a static (Typescript) class, inside of an Angular 2 template? In other words, I want a for/in loop which iterates over an object instead of an array (so a normal *ngFor won't work). As far as I can tell, there is no directive in Angular 2 to do this, so I am wondering what the best way is?
For reasons to do with the module importing, the object must be brought in as a static class, and that data has to imported and then iterated over inside of another Angular component's template.
The static class looks like this:
class staticClassExample {
static string1 = ""
static string2 = ""
static string3 = ""
}
And this is imported into an Angular 2 component:
import { staticClassExample } from './example';
@Component({
template: '
// LOOP NEEDS TO GO HERE
'})
export class Example {
dataToIterateOver: any;
constructor (private _myService: MYSERVICE)
{
this.dataToIterateOver = staticClassExample;
}
}