Hi Sander,

Yes I'm stuck at this angular's digest cycle.

MODELs: 
      currentFilter: it makes my left side selected boxes to show pushed 
items into it as selected.
      filterData: this model is watched in all charts that triggers their 
update

I have a single function that handles charts & multiselect box clicks, 
which after setting up the desired values in currentFilter  and filterData 
executes the populateSelectedFilters which is causing a cyclic call of 
events as it starts with each filter on the left, firing a async get query 
and pushing data in its corresponding currentFilter. But It fails to 
satisfy my usecase which is to make all select box's to highlight only 
relevant items and it enters into a cycle of calling 
populateSelectedFilters while in this function I'm only modifying 
currentFilter which is nowhere watched. I have a workaround with jquery 
 which does a traversel of all options and depending on what get request 
returned pushes the relevant items into jquery selected multiselect boxes.

I'm perplexed how can I handle it without doing a manual dom manipulation.

Thanks

On Thursday, October 8, 2015 at 10:16:18 AM UTC+5:30, Sander Elias wrote:
>
> Hi Rohit,
>  
>
>>
>> Ultimately is there any angular design pattern for a app that will be 
>> have a 10 multiselect boxes, 10 charts, such that any click with start 
>> filtering other charts or filters/multiselect boxes. Now if we put event 
>> listener for say tableA, it will change tableA's data, that will make 
>> tableB's data to change, which then C, then come to A again, How to do this 
>> with angular when I'm confused to implement it on plain javascript.
>>
>
> Ah, good question. I'm afraid you won't believe my answer. There is no 
> such design pattern to do this with angular. Don't despair just yet ;) 
> Why? oh my god WHY? are you probably asking yourself now. Well, there is 
> no need for such a thing, as angular automatically takes care of this. 
> Actually it is the core business of angular, to make sure that any change 
> you make to your data, cascades trough your entire app. Even when it 
> involves a lot of chained reactions.
> In a well written angular app, the view gets updated from your models. Any 
> change somewhere in your model's will get reflected in your UI. If changes 
> cascade, angular makes sure this will get reflected to the view. In really 
> complex cases, you might hit an error on the maximum number of digests. If 
> that happens, rest assured that that is (more or less) easily fixable.
>
> In your app, make sure that you see your filterData as a part of your 
> models. 
>
> If any of this is unclear to you, don't hesitate to ask for clarification. 
>
> Regards
> Sander
>
>>

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