AngularJS Dynamic Directives and Method Binding

[亡魂溺海] 提交于 2019-12-11 09:56:49

问题


I'm trying to create an AngularJS version of the Bootstrap Panel to learn about dynamic directives. So far I've created a directive where you can insert arbitrary other directives, in example:

  <panel panel-model="panel" toggle-collapse="toogleCollapse">
    <panel-body>
      <some-other-directive display-text="panel.content" ></some-other-directive>
    </panel-body>
  </panel>

The panel directive has an isolated scope, that's why I'm passing the toggleCollapse function to the directive. Inside the panel template the function should be invoked via ng-click, but this never happens. Any hints are appreciated!

Regards, Andi

There's a plunk to illustrate the problem.

[Update] Problem solved and plunk updated.

来源:https://stackoverflow.com/questions/27939537/angularjs-dynamic-directives-and-method-binding

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!