angular-deckgrid icon indicating copy to clipboard operation
angular-deckgrid copied to clipboard

Custom Watcher

Open kkolstad-trov opened this issue 10 years ago • 2 comments

My company is using angular-deckgrid and we ran into issues with the watcher being too complex because we have circular references in our objects. This PR allows you to supply a function which is used to create a string that will be used as the watch expression.

kkolstad-trov avatar Mar 08 '14 17:03 kkolstad-trov

I'm running into a similar need +1 this PR

mikepugh avatar Mar 27 '14 02:03 mikepugh

I'm having a similar issue with circular dependency. The deck can still render, but only after a long and painful list of RangeError: Maximum call stack size exceeded errors. I found out it might be because of this line 197 in the code:

watcher = this.$$scope.$watch('model', this.$$onModelChange.bind(this), true);

The deep watch over here is makes circular dependency not work. While in my company usecase, I changed it to $watchCollection and remove true it works fine, I'm wondering what may be other cases in which true param at the end might be useful.

I could create a PR to make this change but I'm unsure if this's the intended usecase.

Thanks

wakandan avatar Apr 14 '14 02:04 wakandan