这里是我的代码Transclude在链接功能不注射
'use strict';
angular.module('app')
.directive('item'
, ["$timeout"
, "$Service"
, function(
$timeout
, $utils) {
return {
restrict: 'A',
scope: {
item: '=',
},
transclude: true,
link: function(scope, element, attrs, ctrl, transclude){
},
templateUrl: $fsUtils.getRelativeUrl('templates/item.html'),
controller: 'ItemCtrl',
};
}]);
我的index.html:
<item><div>Transcluded content.</div></item>
transclude变量是undefined
和Ctrl变量为proto__: Object
。 我需要将父范围注入transcluded作用域。 transclude变量是未定义的。我哪里错了。
我的角度版本是1.1.5
谢谢。
我可以看看'item.html'? –