[英]Angular-ui-router is deleted automatically
因此,我使用yeoman做一個基礎項目。 安裝后,我想使用Angular-ui-router,所以我會bower install ui-router
。 我在index.html中注入了<script src="bower_components/angular-ui-router/release/angular-ui-router.js"></script>
,並按照許多教程中的說明進行了所有操作。 但是問題出在我做grunt serve
,被注入index.html的<script src="bower_components/angular-ui-router/release/angular-ui-router.js"></script>
自動刪除。 我需要那個組件。 你們能幫我解決這個問題嗎?
在安裝Bower組件時添加--save或--save-dev,這會將已安裝的組件添加到bower.json中。
bower install ui-router --save
通過--save安裝Bower組件后,grunt serve會將所有Bower.json文件從Bower.json添加到index.html文件。 因此,您無需手動將Bower組件添加到index.html
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.