I have already added AngularJS definitions. Currently, my application controller is as follows:
app.controller('appController',
[
'$scope',
'$state',
'utilityService',
appController
]);
function appController(
$scope: ng.IScope,
$state,
utilityService
) {
var app = this;
$scope.broadcast = function (val) {
$scope.$broadcast('broadcast', val);
};
if (app.auth.user.isAuthenticated()) {
app.state.text = null;
$state.transitionTo('home.content', { content: 'overview' });
} else {
$state.transitionTo('authentication');
app.state.text = "Please Login ...";
}
}
Should I convert to a class if I want to make full use of TS, and if so, how do I handle the definition of functions, such as a broadcast function?
user3568783
source
share