我正在使用 Angular 的 ng-include,如下所示:
主要的html:
<span ng-include="'tpl.html'" ng-controller="TplCtrl" onload="loadMe()"></span>
模板 tpl.html:
<h2>{{ tplMessage }}</h2>
控制器:
$scope.loadMe = function () {
$scope.tplMessage = 'template';
}
})
这在 angularjs 1.1.5 中运行良好,但在 1.2.0 rc 3 中不再适用
这是一个 plunkr: http ://plnkr.co/edit/zYRevS?p=preview
知道如何使用 1.2.0 进行这项工作吗?
编辑:我看到了这个:https ://github.com/angular/angular.js/issues/3584#issuecomment-25279350 但在这里找不到这个问题的答案。