這是現在我的應用程序結構:AngularJs EXEC命令
的index.html
<html ng-app="employeeApp">
<body ng-controller="indexController as indexCtrl">
<div ng-view>
<div ng-init="indexCtrl.validateUser()"></div>
</div>
</body>
</html>
indexController的
function indexController() {
console.log('indexController');
}
employeeController
function employeeController() {
console.log('employeeController');
}
如果我看着我的控制檯employeeController
首先被解僱。這是爲什麼?
- 編輯 -
路由文件
function routeModule($routeProvider)
{
$routeProvider.when('/', {
templateUrl: '../views/login.html',
controller: 'authenticationController',
controllerAs: 'authenticationCtrl'
})
.when('/home', {
templateUrl: '../views/index.html',
controller: 'homeController',
controllerAs: 'homeCtrl'
})
.when('/werknemer/:id', {
templateUrl: '../views/employee/employee.html',
controller: 'employeeController',
controllerAs: 'employeeCtrl'
})
.otherwise({
redirectTo: '/'
});
}
})();
您需要提供更多的代碼。在哪裏爲'employeeController'路由代碼和查看代碼? –