0

我想使用 angular-translate-loader-partial 插件拆分我的 json 翻译文件

bower install angular-translate-loader-partial

不会在我的 index.html 中连接 .js 文件(即使使用 --save-dev)所以我手动实现了它

<!-- 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/dist/js/bootstrap.js"></script>
<script src="bower_components/angular-animate/angular-animate.js"></script>
<script src="bower_components/angular-cookies/angular-cookies.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/swiper/dist/idangerous.swiper.js"></script>
<script src="bower_components/angular-translate/angular-translate.js"></script>
<!-- endbower -->
<!-- endbuild -->

<script src="bower_components/angular-translate-loader-partial/angular-translate-loader-partial.js"></script>

    <!-- build:js({.tmp,app}) scripts/scripts.js -->
    <script src="scripts/app.js"></script>
    <script src="scripts/controllers/main.js"></script>
    <script src="scripts/controllers/about.js"></script>
    <script src="scripts/controllers/menu.js"></script>
    <script src="scripts/controllers/shareform.js"></script>
    <!-- endbuild -->

在 liveview 期间它确实可以工作,但是如果我执行“grunt build”它就不再工作了可能它不是构建的一部分

4

1 回答 1

0

你需要把它放在dependencies你的 bower.json 中。为了将来参考,请使用--save依赖项和--save-devdevDependencies 的标志。

于 2015-01-07T15:38:50.460 回答