angular-bootstrap 手风琴无法打开 [英] angular-bootstrap accordion won't open

查看:23
本文介绍了angular-bootstrap 手风琴无法打开的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Plunker:http://plnkr.co/edit/Sjfb3Esx1NsjwaYGLMGZ?p=preview

Accordion 位于服务器选项卡中.

plunker 确实有效.我真正的应用程序没有.plunker 唯一没有真正复制的是 ui-router 的东西.在我的实际应用中,手风琴无法打开.SO 上的其他问题说 ui.bootstrap 不包括在内并且解决了他们的问题.不过我确实包含了 ui.bootstrap.

我还尝试从 http://angular-ui.github 复制和粘贴示例.io/bootstrap/ 也不起作用.

我不知道还有什么要找的.

更多信息:

我没有收到任何错误.其他 ui-bootstrap 指令也可以正常工作.我在同一页面上使用选项卡,而在其他页面上使用模态和下拉菜单.

解决方案

根据我的评论:

<块引用>

这是我的模板.不知何故,我的模板文件与 js 文件不同步.在模板中,它调用了我的代码中不存在的 ng-click="toggleOpen()".当我将其回滚到 ng-click="isOpen = !isOpen" 时,一切都按预期工作.我需要弄清楚为什么我的模板和 js 文件不同步.

我使用不包含模板文件的 bower 安装了 ui-bootstrap.我需要在开发过程中禁用模板缓存,所以我不能使用 tpls 代码.我从 github 下载了模板目录,其中一些模板与 bower 下载的代码版本不匹配.我将模板文件更新为与 bower 中的代码正确匹配的旧版本.现在一切正常.

Plunker: http://plnkr.co/edit/Sjfb3Esx1NsjwaYGLMGZ?p=preview

Accordion is in the servers tab.

The plunker actually works. My real app does not. The only thing that plunker is not really replicating is the ui-router stuff. On my actual app the accordion won't open. Other questions on SO say that ui.bootstrap is not included and that fixed their problem. I do have ui.bootstrap included though.

I've also tried copying and pasting the example from http://angular-ui.github.io/bootstrap/ that doesn't work either.

I'm at a loss for what else to look for.

More info:

I'm not getting any errors. Also other ui-bootstrap directives work just fine. I'm using tabs on this same page, and modal and dropdown work on other pages.

解决方案

As per my comment:

It's my template. Somehow my template files are out of sync with the js files. In the template it is calling ng-click="toggleOpen()" which does not exist in my code. When I roll that back to ng-click="isOpen = !isOpen" everything works as expected. I need to figure out why my templates and js files are out of sync.

I installed ui-bootstrap using bower which does not include template files. I need to disable template caching during development so I can't use the tpls code. I downloaded the template directory from github and some of the templates simply do not match up with the version of code that bower downloads. I updated the template file to an older version that correctly matches the code from bower. Everything works now.

这篇关于angular-bootstrap 手风琴无法打开的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆