angular.module(‘MobileApp.routes’, [‘ngRoute’])
.config([’$routeProvider’, function($stateProvider, $urlRouterProvider, $routeProvider) {
$stateProvider
.state(‘login’, {
url: ‘/login’,
templateUrl: ‘templates/login.html’,
controller: ‘LoginCtrl’
})
.state(‘home’, {
url: ‘/home’,
templateUrl: ‘templates/home.html’,
controller: ‘homeCtrl’
})
$routeProvider.when(’/login’ {
templateUrl:‘templates/login.html’,
controller:‘LoginCtrl’
});
$routeProvider.when(’/home’, {templateUrl: ‘templates/home.html’,controller:‘HomeCtrl’});
$urlRouterProvider.otherwise({redirectTo: ‘/login’});
}]);
JC_cap
#2
angular.module('MobileApp.routes', ['ngRoute'])
.config(['$routeProvider', function($stateProvider, $urlRouterProvider, $routeProvider) {
$stateProvider
.state('login', {
url: '/login',
templateUrl: 'templates/login.html',
controller: 'LoginCtrl'
})
.state('home', {
url: '/home',
templateUrl: 'templates/home.html',
controller: 'homeCtrl'
})
$routeProvider.when('/login' {
templateUrl:'templates/login.html',
controller:'LoginCtrl'
});
$routeProvider.when('/home', {
templateUrl: 'templates/home.html',
controller:'HomeCtrl'
});
$urlRouterProvider.otherwise({
redirectTo: '/login
'});
}]);
You are missing a comma on “$routeProvider.when(’/login’,” or you one have comma in “$routeProvider.when(’/home’,” that is not in the right place