如何设置index.html以确保正确引用了最新版本的angular-ui-bootstrap?

时间:2019-03-29 18:21:53

标签: angular-ui-bootstrap

我正在使用Angular JS构建的MEAN堆栈应用程序,我想在该应用程序中使用最新版本的Angular-UI-Bootstrap。我是新手,在阅读了有关如何实现此方法的所有信息后非常困惑。我正在寻找确认我的设置已经正确完成的信息,或者是有关如何解决问题的建议。

到目前为止已采取的步骤:

npm install angular-ui-bootstrap
npm install angular-touch
npm install bootstrap@3

这在我的node_modules目录中安装了angular-ui-bootstrap(版本2.5.6),angular-touch和bootstrap文件夹以及相应的文件。

我将ui.bootstrap作为依赖项插入到app.js文件中,如下所示:

var myApp = angular.module('myApp', ['ui.bootstrap', 'other_depenendencies'])

但是,在我的index.html文件中,已经在index.html文件的不同部分中看到了以下内容(当然,没有数字):

1. <link href="assets/css/bootstrap.min.css" rel="stylesheet">
2. <script src="assets/plugins/bootstrap-3.3.2/js/bootstrap.min.js"></script>
3. <script src="directives/ui-bootstrap-1.3.3.min.js"></script>
4. <script src="directives/ui-bootstrap-tpls-1.3.3.min.js"></script>
5. <script src="directives/ui-bootstrap-1.3.3.min.js"></script>
6. <script src="directives/ui-bootstrap-tpls-1.3.3.min.js"></script>
7. <script src="assets/plugins/bootstrap-3.3.2/js/bootstrap.min.js"></script>

我的问题:

  1. 是否存在一个原因,为什么需要在index.html中多次引用bootstrap.min.js文件(我想不到一个)?如果没有这样的理由,我想删除上面的引用5、6和7是安全的吗?

在我的node_modules文件夹中安装的angular-ui-bootstrap版本(2.5.6)在node_modules / angular-ui-bootstrap / dist中具有以下文件:

a)ui-bootstrap.js

b)ui-bootstrap-csp.css

c)ui-bootstrap-tpls.js

  1. 这些新安装的文件均未在文件名中显示版本号(就像index.html中引用的文件一样)。那么,我可以查看不正确的文件集吗,还是在最新版本的软件包中使用这种正常的命名约定?

  2. 我想我可以简单地将ui-bootstrap.js和ui-bootstrap.tpls.js复制到另一个文件夹(该文件夹托管其他CSS文件),并在index.html文件(和替换上面的参考文献3和4)还是将这些文件从出现问题的安装文件夹中移出?

0 个答案:

没有答案