Angular-translator module 'pascalprecht.translate' not found

I am trying to add angular-translate to my angular app. I followed this simple quick start: https://angular-translate.github.io/docs/#/guide but my app won't load, resulting in the following error:

Unprepared error: [$ injector: modulerr] Failed to instantiate module myApp due to: Error: [$ injector: modulerr] Failed to instantiate module pascalprecht.translate due to: Error: [$ injector: nomod] Module 'pascalprecht. translate 'is not available! You either misspelled the name of the module, or forgot to load it. If registering the module ensures that you specify the dependencies as the second argument.

My index.html file correctly includes the angular translation, for example:

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

      

What is the clue why this might be happening? I am very grateful for the help.

UPDATE

Here's part of my app.js to clarify things a bit:

var app = angular.module('myApp', [
  'ngAnimate',
  'ngCookies',
  'ngResource',
  'ngSanitize',
  'ngTouch',

  // 3rd party modules.
  'ui.router',
  'restangular',
  'angular.filter',
  'ui.bootstrap',
  'pascalprecht.translate',


  // Custom modules.
  'myApp.config'
])
.
.
.

      

+3


source to share


3 answers


It was unsuccessful due to another dependency throwing an error, in particular jquery.easy-pie-chart. I didn't use this dependency at all, so I removed it and angular-translate started working without issue.



0


source


I faced the same problem, resolved it by adding below entries. Also remember to put these .js files in the correct order.

files : [
         '../js/libs/angular.js',    
          '../libs/angular-route.js', 
          '../angular-translate.min.js',
          '../libs/angular-translate-loader-url.js',

      



Hope this helps.

Best regards, Aditi.

+2


source


I had other modules depending on the translation module, so I was able to fix this error by loading it right after angular itself loaded.

+1


source







All Articles