0
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?

1 Answer 1

1
$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

Sign up to request clarification or add additional context in comments.

1 Comment

Thanks, is there anyother way because i am avoiding another js. Because of pressure.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.