这个角度平移加载误差是什么意思?

时间:2015-10-26 03:11:53

标签: angularjs angular-translate

我有这个错误,但我无法理解它的含义

Uncaught Error: [$injector:modulerr] http://errors.angularjs.org/1.3.14/$injector/modulerr?p0=TrackingApp&p1=Typ…oogleapis.com%2Fajax%2Flibs%2Fangularjs%2F1.3.14%2Fangular.min.js%3A17%3A1)

链接到错误:here

这是我的代码:

<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.3.14/angular.min.js"></script>
<script src="{% static 'ecare/js/libs/angular-translate.min.js' %}"></script>
<script src="{% static 'ecare/js/libs/angular-translate-loader-static-files.js' %}"></script>

这些链接已经过检查是正确的

<script src="app.js"></script>

以下是我如何注入依赖项:

var trackingApp = angular.module('TrackingApp', ['controllers', 'directives', 'factories', 'filters', 'pascalprecht.translate']);
angular.module('factories', []);
angular.module('controllers', []);
angular.module('directives', []);
angular.module('filters', []);

//Translations
trackingApp.config(function ($translateProvider) {
        var path_to_json = $('body').data('path-translate').split('en_us.json')[0];



    $translateProvider.useStaticFilesLoader({
        prefix: path_to_json,// path to translations files
        suffix: '.json'// suffix, currently- extension of the translations
    });
//checked that path is correct until here. If I remove the following single line, the app has no error (but not translated)...
        $translateProvider.uses('es_es');
        //.fallbackLanguage('en_us')
        // .useLocalStorage();
    });
trackingApp.run(['CommonData', 'CommonUtils', 'Visibility', '$rootScope', '$http', '$window', '$filter', '$translate',
    function(CommonData, CommonUtils, Visibility, $rootScope, $http, $window, $filter, $translate) {
      //app's code here ...

});

HTML:

    <section class="content-header">
        <h2 class="content-title">
            <div ng-if="!shipment.ordered_phase && api_data.order.tracking.length > 1" translate>
                Shipment #{{getShipmentIndex(shipment)}}
            </div>
            <div ng-if="!shipment.ordered_phase && api_data.order.tracking.length == 1" translate>
                Shipment Tracking
            </div>
            <div ng-if="shipment.ordered_phase || api_data.order.tracking.length == 0" translate>
                Order Status
            </div>
        </h2>
    </section>

0 个答案:

没有答案