I have this app.js file
angular.module('myApp', [
'myApp.version',
'ui.router'
]).
config(['$locationProvider','$urlRouterProvider','$stateProvider', function($locationProvider,$stateProvider, $urlRouterProvider, $httpProvider) {
$urlRouterProvider.otherwise('/view1');
$stateProvider
.state('view1', {
url: '/view1',
templateUrl: 'partials/view1.html'
//controller: 'view1.MainController'
})
.state('view2', {
url: '/view2',
templateUrl: 'partials/view2.html'
})
.state('view3', {
url: '/view3',
templateUrl: 'partials/view3.html'
})
.state('view4', {
url: '/view4',
templateUrl: 'partials/view4.html'
});
}]);
I have included "https://cdnjs.cloudflare.com/ajax/libs/angular-ui-router/0.3.1/angular-ui-router.min.js" CDN in my index.html file and it is getting loaded fine.
But even when it is loaded the console is giving an error as
Failed to instantiate module myApp due to: TypeError: $urlRouterProvider.otherwise is not a function
I tried removing this line and then test the code, but then it gives
Failed to instantiate module myApp due to: TypeError: $stateProvider.state is not a function
I have gone through the code multiple times but I am unable to identify the mistake/error.
(angular version is 1.5.8 and angular-ui-router version is 0.3.1 ,if that helps)
Please Help!