【发布时间】:2019-05-28 21:46:39
【问题描述】:
我有一个大指令,其中包含我收到错误的子指令。正是在main指令的link函数中调用transcludeFn()的步骤:
var link = function ($scope, elem, attr, parentCtrl, transcludeFn) {
// Run all nested directives in order to properly register columns in grid.
transcludeFn();
// Add compiled content to directive element.
elem.after($compile(template)($scope));
};
无法解决这个问题。我在文档中错过了什么?将 $onInit 添加为 described here 并没有帮助(我不确定我这样做是否正确)。
我不熟悉 AngularJS,所以任何帮助都会是一个好点。
【问题讨论】:
标签: angularjs angularjs-directive angularjs-compile