I have the following app in index.js:
angular.module('myApp', ['ngRoute', 'ngAnimate']);
.config(function($urlRouterProvider, $locationProvider, $routeProvider) {
$urlRouterProvider.otherwise('/');
$locationProvider.html5Mode(true);
});
And I have 2 routes /about and /contact, each route has his own file with controller (contact.controller.js) and contact.js where I configure the route like:
angular.module('myApp')
.config(['$routeProvider',
function($routeProvider) {
$routeProvider.when('/about', {
templateUrl: 'assets/javascript/about/about.html',
controller: 'AboutCtrl',
controllerAs: 'vm'
});
}
]);
My issue is if I do like this I recive this error
Uncaught Error: [$injector:nomod] http
But works I remove .config() from index.js.
What I'm doing wrong, can someone explain me how can I keep both configs?