AngularJS Dynamic Directives and Method Binding

2019-08-05 19:11发布

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.

0条回答
登录 后发表回答