As an example, I have the following class:
module app.components.base {
export class BaseController<S extends IAppScope, A> {
public data:string;
constructor(public $scope: S, public service: A, public $state: ng.ui.IStateService, public $ionicHistory) {
console.log('Base Controller Loaded!');
console.log($scope);
$scope.vm = this;
}
}
}
Then I have this separate class:
module app.components.properties {
export class PropertiesController extends base.BaseController<IPropertiesScope, app.services.PropertyService> {
}
}
So, in my mind, this says "The Properties Controller extends the Base Controller. The Properties Controller therefore should have this.$scope, and this.$scope should be of type IPropertiesScope since the generic type S inherits the IPropertiesScope interface`."
However, $scope is undefined in the constructor of my base class. Why is this value undefined?