Do you mean writing 

var vm = this in the beginning of the controller?

Thanks,
Ankit


On Monday, 16 September 2013 06:03:21 UTC+5:30, Nick O'Neill wrote:
>
> That's a smart default as it avoids a lot of confusion for new users.
>
> However, an optional namespace parameter would be a good way to quickly 
> improve performance on larger apps. Think of it this way: you can 
> optionally assign a namespace to angular components that deal with $scope. 
> By default all these components are part of the 'main' namespace but 
> specifying a secondary namespace limits the effects of digests to the 
> specified namespace.
>
> This would reduce reliance on unwatch or bind once code snippets that have 
> been popping up, as watches won't be triggered across different namespaces.
>
> Additionally, you could manually trigger changes between namespaces if 
> only certain circumstances should cause different namespaces to update.
>
> Happy to go on in more detail about how this particular setup would help 
> my project, and possibly others. Or if you know this has already been 
> suggested, point me to a place I can +1.
>
> On Sunday, September 15, 2013 5:23:58 AM UTC-7, Grant Rettke wrote:
>>
>> Speaking without having studied it myself, I can parrot the literature 
>> to tell you that as per Andy's reply below, the inference engine has 
>> to analyze every dependency, because every time a change is made, 
>> watches and so on could modify more data, initiating more events, the 
>> engine has no way to know more than you tell it. That is kind of the 
>> value add of the inference engine, and one of the caveats, too. 
>>
>> On Fri, Sep 13, 2013 at 7:25 AM, Nick O'Neill <[email protected]> 
>> wrote: 
>> > I'm doing some performance testing on mobile devices using PhoneGap and 
>> > AngularJS and I came across some behavior that I was hoping someone 
>> could 
>> > explain to me: 
>> > 
>> > One controller which has a service dependency. It uses a $watch on that 
>> > service to know when new data comes in and to update the $scope. This 
>> is 
>> > fast when small amounts of data are $watched, slower with large amounts 
>> of 
>> > data (I assume this is due to dirty checking, and also: duh). 
>> > 
>> > A totally different controller/service hooked up in a similar way with 
>> very 
>> > little data being $watched. Keep in mind the two services don't share 
>> the 
>> > same data or anything. 
>> > 
>> > Both controllers have methods kicked off at the same time, they seem to 
>> > complete (measuring by watching when objects change on the page) at 
>> exactly 
>> > the same time. I expected that I could decouple some slower parts of my 
>> app 
>> > from faster parts and expect parts of my app to be fast, while others 
>> are 
>> > slow just due to the volume of data. But it appears that multiple 
>> controller 
>> > performance is limited by the slowest individual. These controllers are 
>> in 
>> > parallel, not nested, but they are part of the same app module. 
>> > 
>> > Does anyone know angular internals well enough to explain why this 
>> occurs? I 
>> > can post a small repro case if anyone thinks this is actually wrong 
>> > behavior. I'm using 1.0.8. 
>> > 
>> > Thanks! 
>> > 
>> > -- 
>> > 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/groups/opt_out. 
>>
>>
>>
>> -- 
>> Grant Rettke | ACM, AMA, COG, IEEE 
>> [email protected] | http://www.wisdomandwonder.com/ 
>> “Wisdom begins in wonder.” --Socrates 
>> ((λ (x) (x x)) (λ (x) (x x))) 
>> “Life has become immeasurably better since I have been forced to stop 
>> taking it seriously.” --Thompson 
>>
>

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