I have an angular2 component like this:
@Component({
selector: 'demo',
template: `
<div [innerHTML]="content"></div>
`;
})
export class demoComponent {
@Input() step: string;
private content: string = '';
ngOnInit () {
if (this.step === "foo") {
this.content = "bar";
}
}
}
and I want to use some logic to decide on the most appropriate template to render. I have a series of static html files served by express on myDomain.com/templates. So I need to be able to "read" ./templates/xyz.html into a string in my ng2 component. Similarly to the fs.ReadFileSync API in nodeJS. How can I do this? HTTP call? file reader?