Angular UI 手风琴的问题
Issues with Angular UI Accordion
我在使用 Angular 手风琴时遇到了一些问题。这是 HTML/Angular 代码:
<accordion id="accordion1" close-others="true">
<accordion-group heading="Static Header" is-open="false" ng-repeat="service in userPF.custom.services">
<accordion-heading><input type="checkbox" name="status" disabled>On <input type="checkbox" name="status" disabled checked>Off {{service.name}} {{service.desc}}</accordion-heading>
<div class="secondary" ng-repeat="fields in userPF.custom.fields">
<span ng-show="checkForMatch(service.name, fields.services)">
<span ng-repeat="value in fields.values">
{{value.name}} {{value.desc}}<br>
</span>
</span>
</div>
</accordion-group>
</accordion>
当我 运行 此代码时,出现以下错误:
Error: [$compile:ctreq] Controller 'accordionGroup', required by
directive 'accordionHeading', can't be found!
UI 似乎链接正确,但为了以防万一,这里是适当的行:
var myApp = angular.module('LSPortal', ['ngResource', 'ngRoute', 'checkBoxFilters', 'ui.bootstrap']) //...etc...
在询问之前查看了 this question 并相应地修改了我的代码:
post 会 fiddle 但控制器非常非常长,而且与这个特定问题几乎无关。但如果需要的话会做。
问题是您必须小心如何将 UI Bootstrap 与 Bootstrap 和 jQuery 与已包含的 jQuery 精简版一起使用在 Angular。
我找到了答案 here。
我在使用 Angular 手风琴时遇到了一些问题。这是 HTML/Angular 代码:
<accordion id="accordion1" close-others="true">
<accordion-group heading="Static Header" is-open="false" ng-repeat="service in userPF.custom.services">
<accordion-heading><input type="checkbox" name="status" disabled>On <input type="checkbox" name="status" disabled checked>Off {{service.name}} {{service.desc}}</accordion-heading>
<div class="secondary" ng-repeat="fields in userPF.custom.fields">
<span ng-show="checkForMatch(service.name, fields.services)">
<span ng-repeat="value in fields.values">
{{value.name}} {{value.desc}}<br>
</span>
</span>
</div>
</accordion-group>
</accordion>
当我 运行 此代码时,出现以下错误:
Error: [$compile:ctreq] Controller 'accordionGroup', required by directive 'accordionHeading', can't be found!
UI 似乎链接正确,但为了以防万一,这里是适当的行:
var myApp = angular.module('LSPortal', ['ngResource', 'ngRoute', 'checkBoxFilters', 'ui.bootstrap']) //...etc...
在询问之前查看了 this question 并相应地修改了我的代码:
post 会 fiddle 但控制器非常非常长,而且与这个特定问题几乎无关。但如果需要的话会做。
问题是您必须小心如何将 UI Bootstrap 与 Bootstrap 和 jQuery 与已包含的 jQuery 精简版一起使用在 Angular。
我找到了答案 here。