anglejsアプリに角度ブートストラップを正しく挿入するにはどうすればよいですか?私は手動でindex.html
に次のコードを持つライブラリのリモートバージョンを含めると角度ブートストラップが注入されないのはなぜですか?
は、角度ブートストラップは作品:
<!-- start manual dependencies for testing purposes -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/angular.js/1.5.0/angular.js" data-semver="1.5.0" data-require="[email protected]"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/angular.js/1.5.0/angular-animate.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/angular.js/1.5.0/angular-route.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/angular.js/1.5.0/angular-touch.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/angular.js/1.5.0/angular-cookies.js"></script>
<link data-require="[email protected]" data-semver="0.13.1" rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.5/css/bootstrap.min.css" />
<script data-require="[email protected]" data-semver="0.13.1" src="https://cdnjs.cloudflare.com/ajax/libs/angular-ui-bootstrap/0.13.1/ui-bootstrap-tpls.js"></script>
<!-- end manual dependencies for testing purposes -->
しかし、アプリは(JavaScriptがで動作しないことを意味をコンパイルを停止しますすべて唯一のHTMLがブラウザに提供されます)私は依存関係を自動的に管理しようとします。
私はthis other posting on the same topicを読み、次のようにその提案を試してみましたので、これが重複投稿はありません:
[[email protected] client]$ bower install angular-bootstrap
bower cached git://github.com/angular-ui/bootstrap-bower.git#1.2.5
bower validate 1.2.5 against git://github.com/angular-ui/bootstrap-bower.git#*
[[email protected] client]$
バウアーは、その後、マニュアルが上に示し含んで置き換えるindex.html
、中に含まれての次のリストを生成します。
<!-- build:js(.) scripts/vendor.js -->
<!-- bower:js -->
<script src="bower_components/jquery/dist/jquery.js"></script>
<script src="bower_components/angular/angular.js"></script>
<script src="bower_components/bootstrap-sass-official/assets/javascripts/bootstrap.js"></script>
<script src="bower_components/angular-animate/angular-animate.js"></script>
<script src="bower_components/angular-aria/angular-aria.js"></script>
<script src="bower_components/angular-cookies/angular-cookies.js"></script>
<script src="bower_components/angular-messages/angular-messages.js"></script>
<script src="bower_components/angular-resource/angular-resource.js"></script>
<script src="bower_components/angular-route/angular-route.js"></script>
<script src="bower_components/angular-sanitize/angular-sanitize.js"></script>
<script src="bower_components/angular-touch/angular-touch.js"></script>
<script src="bower_components/angular-bootstrap/ui-bootstrap-tpls.js"></script>
<!-- endbower -->
<!-- endbuild -->
そしてbower.json
次のものが含まれます。
{
"name": "client",
"version": "0.0.0",
"dependencies": {
"angular": "^1.4.0",
"bootstrap-sass-official": "^3.2.0",
"angular-animate": "^1.4.0",
"angular-aria": "^1.4.0",
"angular-cookies": "^1.4.0",
"angular-messages": "^1.4.0",
"angular-resource": "^1.4.0",
"angular-route": "^1.4.0",
"angular-sanitize": "^1.4.0",
"angular-touch": "^1.4.0",
"angular-bootstrap": "^1.2.5"
},
"devDependencies": {
"angular-mocks": "^1.4.0"
},
"appPath": "app",
"moduleName": "clientApp",
"overrides": {
"bootstrap": {
"main": [
"less/bootstrap.less",
"dist/css/bootstrap.css",
"dist/js/bootstrap.js"
]
}
}
}
アプリのコンパイルおよびHTTPは上部に含まれている場合、正しくJavaScriptを実行しますが使用されているので、あなたは本当に私がアプリモジュールにui.bootstrap
を注入しています方法を知っている必要はありませんが、徹底のために、次のように私には含めています:
angular
.module('app', ['ngAnimate', 'ngRoute', 'ngTouch',
'auth', 'home', 'secure', 'public1', 'navigation',
'ui.bootstrap' ])
ローカルブートフォルダーからアプリに角度ブートストラップを正常に挿入するためには、上記にどのような変更を加える必要がありますか?
をアプリケーションコードからの相対を含む前と同じ順序でリストされているすべてのファイルは、ありますか?また、あなたのブラウザはあなたのbowerディレクトリを見つけることができますか? – tyler
@tyler角型アプリケーションは、角度ブートストラップを追加しようとするまで自動ビルドで動作するので、ブラウザは確実にbowerディレクトリを見つけることができます。注文は正確にOPに示されている通りです。投稿する必要がある追加ファイルはありますか? – CodeMed
@estusこのアプリはwiredepを使用していません。設定にはnode.js、yeoman、Grunt、bowerが含まれます。 – CodeMed