Angularjs 嵌套指令,都带有模板url
我在一个模块中有两条指令。其中之一是templateUrl属性。在该templateUrl中,我引用了另一个指令,该指令又有一个templateUrl e、 g 这就是我得到的错误: [排除:孤儿]Angularjs 嵌套指令,都带有模板url,angularjs,angularjs-directive,transclusion,Angularjs,Angularjs Directive,Transclusion,我在一个模块中有两条指令。其中之一是templateUrl属性。在该templateUrl中,我引用了另一个指令,该指令又有一个templateUrl e、 g 这就是我得到的错误: [排除:孤儿] 我遇到了一个关于转换的错误,我尝试了一些方法,但没有改变。我想你们可能有一些想法。请分享一下这个错误好吗?显示的html代表的内容有点混乱。。。这在第一个模板中吗?尝试添加有关html所在位置的注释。错误表明您正在其中一个模板中使用ng transclude,但两个指令都没有transclude:t
我遇到了一个关于转换的错误,我尝试了一些方法,但没有改变。我想你们可能有一些想法。请分享一下这个错误好吗?显示的html代表的内容有点混乱。。。这在第一个模板中吗?尝试添加有关html所在位置的注释。错误表明您正在其中一个模板中使用
ng transclude
,但两个指令都没有transclude:true
属性。一个指令比另一个指令更合适吗?我刚刚看到在旋转木马tmpl中,有一个附加了ng tranclude的div。
<div> <!--This is my first partial page which uses the SelectorResult directive -->
Here are some results
<div result-carousel>
<!-- here is where some more html should go from result-carousel -->
</div>
</div>
app.directive('SelectorResult', function () {
return {
restrict: 'AE',
scope: {},
templateUrl: '/chooser/Pages/partials/selector-result-tmpl.aspx',
replace: true,
controller: 'SelectorResultController',
controllerAs: 'resultCtrl'
};
});
app.directive('resultCarousel', function () {
return {
templateUrl: '/chooser/Pages/partials/carousel-tmpl.html'
};
});