I am facing problem with routeProvider, don't know why its not working. The problem is with the config function .Here's the code
var mainApp = angular.module('mainApp', []);
mainApp.config(['$routeProvider' ,function($routeProvider) {
$routeProvider.
when('/', {
templateUrl: 'index.html',
controller: 'indexController'
}).
when('/first', {
templateUrl: 'first.html',
controller: 'firstCtrl'
}).
when('/second', {
templateUrl: 'second.html',
controller: 'secondCtrl'
}).
otherwise({
redirectTo: 'index.html'
});
}])
mainApp.controller('indexController', [function() {
this.outputString = "String from the index controller";
}]);
mainApp.controller('firstCtrl', ['$scope', function($scope) {
$scope.outputString = "String from the first controller";
}]);
mainApp.controller('secondCtrl',['$scope', function($scope) {
$scope.outputString = "String from first controller";
}]);
