dart - 如何使用ng绑定HTML动态添加 HTML如何启动这里HTML的编译?


我的index.html 包含以下元素

<div class="col-md-6" ng-bind-html='module.docs.html'></div>

module.docs.html 属性返回 HTML

<div ng-controller="accordion-demo-ctrl">
 <label class="checkbox">
 <input type="checkbox" ng-model="oneAtATime">
 Open only one at a time

 <accordion close-others="oneAtATime">
 <accordion-group heading="Static Header, initially expanded" is-open="true">
 This content is straight in the template.
 <accordion-group heading="{{group.title}}" ng-repeat="group in groups">
 <accordion-group heading="Dynamic Body Content">
 <p>The body of the accordion group grows to fit the contents</p>
 <button class="btn btn-default btn-sm" ng-click="addItem()">Add Item</button>
 <div ng-repeat="item in items">{{item}}</div>
 <accordion-group is-open="isopen">
 I can have markup, too! <i class="pull-right glyphicon" ng-class="{'glyphicon-chevron-down': isopen, 'glyphicon-chevron-right':!isopen}"></i>
 This is just some content to illustrate fancy headings.

插入了 HTML,但是 Angular.dart 似乎没有做任何事情( accordion-demo-ctrl 未被实例化)

时间: 原作者:

使用 ng-include 指令工作。 我改变了我的代码,以便我提供了 HTML fragment的URI而不是源本身的( 。从服务器获取) 。

请参见我对的回答如何在 Angular.Dart 中以编程方式添加组件? 用于替代解决方案