Vinay, I see. In TypeScrpit when you use 'class' keyword there is no way to 
make the generated properties JS private, even if you use the 'private' TS 
keyword. The reason for that is described 
here http://typescript.codeplex.com/discussions/397651 . As they describe - 
the problem is about JS inheritance overall and the fact that TS 'private' 
keyword behaves like 'protected' keyword of languages with traditional 
inheritance. The problem is more about prototypical inheritance, so 
discussing it here would be of-topic, IMHO.

In consolation, I can say I never had any problems of that sort in projects 
with Controllers like
constructor(public api: ApiService, public $modalInstance: 
ng.IModalInstance, public work: IWorkVM, public $rootScope: ng.IScope, 
public $q: ng.IQService, public $timeout: ng.ITimeoutService) {...}

If you have some specific case where that problem occurs, maybe you could 
email me a description of it to koshelew at gmail com ?


On Wednesday, April 23, 2014 9:43:14 PM UTC+4, Vinay Gangoli wrote:
>
> Thanks for the reply! The examples are very clear and I especially like 
> the handling of nested controllers.
>
> I guess my concern here is I would be able to do 
> controller.$q.anyExposedProp from the view which I would like to prevent.
> Is there any way to achieve this in Typescript?
>

-- 
You received this message because you are subscribed to the Google Groups 
"AngularJS" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.

Reply via email to