Tag:

从外部URL加载Angular2模板

有没有可能从外部网址加载模板? 这是我目前正在做的事情,但Angular似乎忽略了它没有抛出任何错误,页面只是一直加载无限期。 @Component( selector: 'dashboard-page', //templateUrl: '../templates/dashboard-page.html', templateUrl: 'http://localhost:9091/html/dashboard-page.html', directives: const [], pipes: const [] ) class DashboardPage implements AfterContentInit { http://localhost:9091/html/dashboard-page.html我可以直接访问,CORS设置为允许端口8080上的Dart应用程序与端口9091上的Kotlin应用程序通信。 我试图根据帐户配置文件加载不同的HTML模板 – 不同的帐户将看到由Kotlin代码提供的不同的HTML模板。 我这样的事情可以做或不可能为Angular2加载外部模板文件?