I'm using this starter template with the modifications outlined in this SO post. It has been smooth sailing until now - I'm trying to inject a service into the constructor of another service, but the injected value is always 'undefined'. There are no errors thrown.
Here is a simplified example:
module app.services {
export class dashboardFilterService implements IService {
constructor($rootScope: ng.IRootScopeService) {
// $rootScope is undefined...
//$rootScope.$broadcast('FilterInitialized');
}
}
}
app.registerService('dashboardFilterService', ['$rootScope']);
Injecting services into controllers works fine. I am pretty new to typescript as well as angular, so this might be obvious to someone who has more experience with it. Here is the compiled js for reference:
var app;
(function (app) {
(function (services) {
var dashboardFilterService = (function () {
function dashboardFilterService($rootScope) {
// $rootScope is undefined...
//$rootScope.$broadcast('FilterInitialized');
}
return dashboardFilterService;
})();
services.dashboardFilterService = dashboardFilterService;
})(app.services || (app.services = {}));
var services = app.services;
})(app || (app = {}));
app.registerService('dashboardFilterService', ['$rootScope']);