I am loading a page after the login process is complete. Basically login page having one ng-view, after login success I'm trying to load an entirely new page to replace the content.
$routeProvider
.when('/', {
templateUrl: 'views/login.html',
controller: 'loginCtrl',
controllerAs: 'login'
})
.when('/admin/customerview', {
templateUrl: 'views/admin/customerview.html',
controller: 'AdminCustomerviewCtrl',
controllerAs: 'admin/customerview'
})
});
<div class="container-fluid" >
<ng-view></ng-view>
</div>
Make the
controllerAsproperty a simple identifier:Using a slash (
/) in the middle of acontrollerAsidentifier will cause problems when the AngularJS framework tries to compile the template. AngularJS will parse expressions with slash as a divide operator.