I already added the AngularJS definitions. Presently my app controller looks like this:
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.auth.loginData = app.cache.get('loginData');
app.state.text = "Please Login ...";
}
}
Should I convert into a class if I want to take full advantage of TS and if so how do I handle the definition of functions like the broadcast function?