【发布时间】:2017-02-13 22:37:39
【问题描述】:
我想重新编译/编译我的组件的模板。我正在使用 $onInit 加载一个外部模块,当我在页面中的其他位置导航然后再次返回到加载模块的页面时,事情就会出现。
我想我也许可以编译模板。你知道我该怎么做吗?
编辑:
如果我在我的代码中使用编译,什么都不会发生
controller: {
$onInit(){
this.$ocLazyLoad.load('some.module.js');
}
},
template:
'<p>Sample text here</p>',
compile: function (tElement, tAttrs) {
return function(scope) {
scope.widgetCenter = tAttrs.widgetCenter;
};
}
【问题讨论】:
标签: angularjs compilation components