簡體   English   中英

如何手動安裝AngularJS ui.bootstrap

[英]How to manually install AngularJS ui.bootstrap

我正在構建要在SharePoint 2013在線中的頁面上運行的SPA,並且在手動安裝ui-bootstrap時遇到問題。

我已經下載了此文件https://github.com/angular-ui/bootstrap/blob/master/src/modal/modal.js並保存為ui-bootstrap.js。

然后,我在index.html中引用該文件:

 <script src="//code.jquery.com/jquery-1.10.2.js"></script>
 <script src="//code.jquery.com/ui/1.11.4/jquery-ui.js"></script>
  <script type="text/javascript" src="~site/Webparts/js/angular.min.js"></script>
 <script type="text/javascript" src="~site/Webparts/js/angular-route.min.js"></script>
 <script type="text/javascript" src="~site/Webparts/js/ui-bootstrap.js"></script>
 <script type="text/javascript" src="~site/Webparts/testLabApp/testLabApp.js"></script>
 <script type="text/javascript" src="~site/Webparts/testLabApp/dal.js"></script>
 <script type="text/javascript" src="~site/Webparts/testLabApp/email.js"></script>
 <link href="~site/Webparts/testLabApp/style.css" rel="stylesheet" />

然后在App js文件中添加依賴項:

var testLabApp = angular.module('testLabApp', ["ngRoute", "ui.bootstrap"]);

但是,我收到噴油器錯誤:

[$injector:modulerr] http://errors.angularjs.org/1.4.2/$injector/modulerr?p0=testLabApp&p1=Error%3A%20%5B%24injector%3Amodulerr...

顯然,我做錯了什么,但是我找不到如何從github下載正確的文件。

任何幫助是最感激的。

問候克雷格

如果僅使用modal.js,則沒有名為ui.bootstrap的模塊。

嘗試更改:

var testLabApp = angular.module('testLabApp', ["ngRoute", "ui.bootstrap"]);

至:

var testLabApp = angular.module('testLabApp', ["ngRoute", "ui.bootstrap.modal"]);

確保還下載模態的模板文件(window.html和background.html)

看來問題在於您只下載了modal.js,這只是模式部分,而不是ui-bootstrap的全部。

嘗試以下文件: https : //cdnjs.cloudflare.com/ajax/libs/angular-ui-bootstrap/0.13.3/ui-bootstrap.js

或縮小: https ://cdnjs.cloudflare.com/ajax/libs/angular-ui-bootstrap/0.13.3/ui-bootstrap.min.js

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM