【发布时间】:2018-10-26 17:53:08
【问题描述】:
有没有办法包含外部 html 文件,我一直无法使用 templateUrl,它一直将 base 附加到 url 的开头。
@Component({
selector: 'enroll-header',
templateUrl: 'http://blank.blank.com/somecool.html'
})
它会尝试在"./http://blank.blank.com/somecool.html"找到它
失败了
【问题讨论】:
-
您可能正在寻找 ComponentFactoryResolver,其中包含指向 plnkr 和可下载代码的链接。
标签: angular