Reputation: 142
app.config(function ($routeProvider, $locationProvider) { $routeProvider.
when('/login', {
templateUrl: '/Login/_Login.aspx',
controller: 'LoginCtrl'
});
));
The LoginCtrl is in another JS File which is not loaded yet, So i will load that js so it work properly?
Upvotes: 0
Views: 36
Reputation: 11953
$stateProvider
.state('main', {
url: '/main',
templateUrl: 'templates/main/main.html',
controller : 'mainController',
resolve: {
loadReqFiles: ['$ocLazyLoad', function ($ocLazyLoad) {
return $ocLazyLoad.load([
'templates/main/main.css',
'js/controller/main.js',
'js/services/sessionService.js'
]);
}]
}
})
read this for more information... LazyLoad
Upvotes: 1