When I use the ui.router, I got the error message "Error Module" and it failed to instantiate module xPlat. In html file I use the angular-ui-router verson 0.2.11
below is my injection of ui.route :
(function () {
'use strict';
angular.module('xPlat', ['ui.router'])
.config(function ($stateProvider) {
$stateProvider
.state('views', {
url: '/views',
templateUrl: 'views/item.html'
})
.state('views.posItem', {
url: '/views',
templateUrl: 'views/posItem.html'
})
.otherwise('/views');
})
})();
I don't understand about it, why it error?
this is error that I got :
Error: error:modulerr Module Error
Failed to instantiate module xPlat due to:
TypeError: undefined is not a function
at http://localhost:4400/scripts/app.js:14:14
at Object.d [as invoke] (https://ajax.googleapis.com/ajax/libs/angularjs/1.2.0/angular.min.js:30:210)
at https://ajax.googleapis.com/ajax/libs/angularjs/1.2.0/angular.min.js:29:58
at Array.forEach (native)
at q (https://ajax.googleapis.com/ajax/libs/angularjs/1.2.0/angular.min.js:7:261)
at e (https://ajax.googleapis.com/ajax/libs/angularjs/1.2.0/angular.min.js:28:374)
at Xb (https://ajax.googleapis.com/ajax/libs/angularjs/1.2.0/angular.min.js:32:427)
at c (https://ajax.googleapis.com/ajax/libs/angularjs/1.2.0/angular.min.js:17:315)
at Wb (https://ajax.googleapis.com/ajax/libs/angularjs/1.2.0/angular.min.js:18:30)
at Oc (https://ajax.googleapis.com/ajax/libs/angularjs/1.2.0/angular.min.js:17:99
And description of error:
This error occurs when a module fails to load due to some exception. The error message above should provide additional context.