angularjs - Angular ui-bootstrap Accordion 不起作用

标签 angularjs accordion angular-ui

直接复制自的示例
http://angular-ui.github.io/bootstrap/
根本不起作用,无论是在本地还是在 plunker 中。不知道为什么。 Bootstrap CSS 已加载,ui-bootstrap-tpls.min.js 和 angular.min.js 也已加载(但 Angular 本身工作得很好)。
这是笨蛋:
http://plnkr.co/edit/15GWWFSUwab4VmaxfFPf
我在浏览器中没有收到 js 错误,但它不起作用。
请帮忙。我需要在我的网站上实现此功能(即,即使我编写自己的 html/js 代码, Accordion 也无法工作)。

最佳答案

从演示站点创建的 plunker 工作完美,刚刚从演示站点创建了一个 plunker:http://plnkr.co/edit/z9RQKgNBTRbigyQs7OGW?p=preview

在您的 plunker 中,您没有声明对 ui.bootstrap 模块的依赖,如演示页面最顶部所述:

As soon as you've got all the files downloaded and included in your page you just need to declare a dependency on the ui.bootstrap module: angular.module('myModule', ['ui.bootstrap']);

添加对上述模块的依赖关系后,您的插件也可以正常工作: http://plnkr.co/edit/00bK0rNDYIrH9a9TVRk3?p=preview

还有一件事 - 您至少需要 AngularJS 1.0.5 - 早期版本的 AngularJS 中存在错误,导致该指令无法正常工作。

关于angularjs - Angular ui-bootstrap Accordion 不起作用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17596580/

相关文章:

javascript - Angular UI 路由器 - 抽象状态的子级不继承 $stateChangeStart 中的数据

angularjs - logout() 无法使用 Passport.js、express.js、AngularJs 工作

http - 我需要 AngularJS $http 服务的两个实例还是什么?

jquery - 具有动态 ajax 内容的 Bootstrap Accordion

ios - 我可以在 Swift 中仅选择 UITableView 中一行的一部分可单击(可选择)吗?

swift - 在 swift 中使用 tableView(可扩展单元格)制作嵌套的 Accordion 菜单

javascript - 我的指令没有触发

javascript - 我的文本没有添加到 Angular js 的列表项中?

angularjs - orderBy 可以与 AngularUI typeahead 一起使用吗?

javascript - 将选定的语言从 uib-dropdown 语言选择器传递到 $scope