Upon examining the generated javascript, it becomes evident why.
var MyController = (function (_super) {
__extends(MyController, _super);
function MyController() {
_super.apply(this, arguments);
this.myPrivate = 'myPrivateString';
}
return MyController;
}(BaseController));
Your private property is treated like any other property on your controller.
To view the complete transpilation click here.
An effective solution would be to utilize a parameterized base controller that can define a view model for the view to utilize, instead of using the regular $ctrl.
Implementation would resemble the following:
class BaseController<T> {
protected scope;
protected viewModel: T;
constructor(scope: any, modelType: { new (): T; }) {
this.scope = scope;
this.viewModel = new modelType();
this.scope["viewModel"] = this.viewModel;
}
}
class MyParticularViewModel {
public somethingForTheView: string;
}
class MyController extends BaseController<MyParticularViewModel> implements SomeInterface {
private myPrivate: string = 'myPrivateString';
constructor(scope) {
super(scope, MyParticularViewModel);
}
}
In the view, you can then access the necessary properties using the viewModel property.
I have personally applied this approach in a project with successful results. More information and a template I used as a starting point can be found here.