Once the following line of code is executed
cockpit.controller('shell', shellCtrl);
within my primary module, the shell controller gets registered with the Angular application's _invokeQueue. However, for some reason, the code inside the constructor of shellCtrl doesn't seem to be triggered. Any idea why this might be happening?
Below is the TypeScript implementation for shellCtrl
module cockpit {
'use strict';
export class shellCtrl {
public static $inject = [
'$location', '$rootScope', '$scope',
'localize'
];
public userId = 0;
constructor($location, $rootScope, $scope, localize) {
$scope.vm = this;
$rootScope.$on('localizeResourcesUpdated', function () {
$rootScope.title = localize.getLocalizedString('_appTitle_');
});
//If the userid is null go to login
if (this.userId == 0) {
$location.path('/login');
}
}
}
}