angular-translate module 'pascalprecht.translate' not found

Luis Crespo picture Luis Crespo · May 15, 2015 · Viewed 8.5k times · Source

I'm 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 bootstrap, giving me the following error:

Uncaught 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 module name or forgot to load it. If registering a module ensure that you specify the dependencies as the second argument.

My index.html file is properly including angular-translate like so:

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

Any clue why this could be happening?. I'd really appreciate 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'
])
.
.
.

Answer

Aditi picture Aditi · Jul 21, 2015

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

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

Hope, this helps.

Regards, Aditi.