Is there a method for dynamically loading URLs in the templateUrl
property? Similar to the code snippet below:
@Component({
moduleId: module.id,
selector: 'my-app',
templateUrl: DynamicUrl, // Load DynamicUrl here
styleUrls: ['app.component.css']
})
export class AppComponent{
var DynamicUrl= 'app.component.html';
// The template name should ideally be fetched from the server.
}
I'm uncertain about the lifecycle. Where should I initialize and define the DynamicUrl variable and implement the logic to retrieve it from the server?
Any assistance would be greatly appreciated.