I'm passing an object to an AngularJS directive like so:
<context-selector
is-buy="true"
num-to-select="0"
init-object="{ads: rule.ads_list, adContainer: rule.container_ad_id, campaign: rule.campaign_id}">
</context-selector>
and it causes Angular infinite digest loop because of the init-object.
I guess that's because Angular compares the object by reference.
The directive definition is:
directive('contextSelector', function() {
return {
restrict: 'E',
scope: {
vertical: "@",
levelsDepth: "@",
isBuy: "@",
shellsLeft: "=",
numToSelect: "@",
initObject: "=" // {ads: [1,2], adContainer: 4, campaign: 6}
},
Is there a solution to this issue?