指令在与另一个嵌套时停止工作?

Directive stop working when is nested with another?

我正在尝试在示例中嵌套一些指令,看起来我得到了我需要的一切,但没有按预期工作,但如果我将嵌套指令放在父指令之外,它就会被识别

    here is a plunker:http://plnkr.co/edit/eZaYTHm274zWx8GPMAS0?p=preview

这个嵌套指令的主要目的是在控制器之间共享数据并动态构建一组字段。

提前致谢!

资源:https://docs.angularjs.org/guide/directive

您的代码有两个问题:restrict 属性 和 transclude/template 属性。请参阅下面的代码摘录。

return {
    restrict: 'AE', //You need to add "A" if you are using attributes
    transclude: true, // You need to include the ng-transclude directive in your template
    template: '<div> Some Html <div ng-transclude></div></div>',
    ...
};