Can't include ngMessages module in Angularjs app after installing bower

I am having trouble installing and importing the angular-messages module in an angularjs project. Here is the error message

Uncaught Error: [$injector:modulerr] Failed to instantiate module myApp due to:
Error: [$injector:modulerr] Failed to instantiate module ngMessages due to:
Error: [$injector:nomod] Module 'ngMessages' 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.
http://errors.angularjs.org/1.6.4/$injector/nomod?p0=ngMessages
    at http://localhost:8000/bower_components/angular/angular.js:66:12
    at http://localhost:8000/bower_components/angular/angular.js:2262:17
    at ensure (http://localhost:8000/bower_components/angular/angular.js:2183:38)
    at module 

      

As you can see below, I believe I have imported the angular posts module correctly (in index.html).

I've also included images of the file paths and my app.js, which is importing ngMessage. The Bower options seem to be okay too. Any thoughts?

enter image description here

enter image description here enter image description here

enter image description here

+3


source to share


1 answer


Your version is ng-messages

not compatible with AngularJS version. Try strict versions in your dependency config:



{
  "name": "angular-seed",
  "version": "0.0.0",
  "private": true,
  "dependencies": {
    "angular": "1.6.0",
    "angular-route": "1.6.0",
    "angular-loader": "1.6.0",
    "angular-mocks": "1.6.0",
    "angular-messages": "1.6.0"
  }
}

      

+1


source







All Articles