Im wondering what original reasons for not having the controller *be* the
scope were (like it originally was). Is it because of the need for scope
inheritance?

Using 'controller as' the scope is barely referenced, and so scope
inheritance isnt useful to the developer anyway. services are used for
inter-controller sharing anyway. If removing the inheritance simplified the
system, then could the controller *Be* the scope again?

My thinking is that, if inheritance is removed, and a tree is built using
this.parent (for events - as is currently, and is like the DOM for example)
then the controller could just extend a scope class.

'Controller as' is not really needed then, but could just be an attribute
referencing *this* if you wanted that style in the view.







On 24 April 2014 04:20, Кошелев Иван <[email protected]> wrote:

> 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.
>



-- 
Tony Polinelli

-- 
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