将 AngularUI 连接到 Bootstrap 3 抛出错误 [英] Wiring up AngularUI to Bootstrap 3 throwing errors

查看:25
本文介绍了将 AngularUI 连接到 Bootstrap 3 抛出错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我一直在尝试将 AngularUI 连接到 Bootstrap 3,但无济于事.我从这里的 bootstrap 3 分支中获取了适当的 AngularUI 代码:https://github.com/angular-ui/bootstrap/tree/bootstrap3_bis2

I have been trying to wire up AngularUI to Bootstrap 3 to no avail. I grabbed the appropriate AngularUI code from the bootstrap 3 branch here: https://github.com/angular-ui/bootstrap/tree/bootstrap3_bis2

我选择了 AngularUI 工具提示指令作为一个简单的测试用例",看看我是否可以把它全部连接起来.

I picked the AngularUI tooltip directive as an easy "test-case" to see if I can get it all wired up.

我收到的错误是:未捕获的错误:没有模块:ui.bootstrap

There error I am receiving is: Uncaught Error: No module: ui.bootstrap

我已经与下面的 src 代码共享了一个 Dropbox 链接.

I've shared a dropbox link with src code below.

Views/Home/index.cshtml contains the markup with references to angularjs and bootstrap
js/directives contains the only directive I am currently testing out which is the "tooltip" directive.

带有 src 代码的 Dropbox 链接https://www.dropbox.com/sh/elwn0su5qwnqa27/zetaMxAa4Q

Dropbox link with src code https://www.dropbox.com/sh/elwn0su5qwnqa27/zetaMxAa4Q

我不必下载 bootstrap 3 指令并手动将它们放入我的项目中,现在是否有一个 CDN 可用于 AngularUI-Bootstrap3 指令,就像 AngularUI-Bootstrap2 一样?

Instead of my having to download the bootstrap 3 directives and place them manually in my project, is there now a CDN available for AngularUI-Bootstrap3 directives like there is for AngularUI-Bootstrap2?

感谢您的帮助,

V/R

克里斯

推荐答案

这是因为您试图仅提取 AngularUI 源的一部分,而不是编译版本.

It's because you try to extract only one part of AngularUI sources, not compiled version.

因此您缺少ui.bootstrap"(当然还有其他部分)的模块声明.

So you lack the module declaration for 'ui.bootstrap' (and surely other pieces).

由于没有完成 Bootstrap 3 的兼容性,所以这个 AngularUI 版本没有编译版本(也没有更多的 CDN).

As Bootstrap 3 compatibility is not done, there is no compiled version (and no more CDN) for this AngularUI version.

您必须从分支 bootstrap3_bis2 获取所有源代码,并使用 grunt 构建它们.它在项目 README 中有解释(Contributing to the project > Build).

You have to get all sources from branch bootstrap3_bis2, and build them with grunt. It's explain in project README (Contributing to the project > Build).

它将生成 2 个 JS 文件(一个被缩小,另一个没有)您必须将其中一个包含到您的页面中,它才能正常工作.

It will generate 2 JS files (one is minified and the other is not) you have to include one of them to your page and it will works correctly.

这篇关于将 AngularUI 连接到 Bootstrap 3 抛出错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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