I want to have an attribute directive that can be used as follows:
<div my-dir="{items:m.items, type:'0'}"></div>
In my directive, I can turn this into an object like:
function (scope, element, attributes, modelController)
{
var ops = $.extend({}, scope.$eval(attributes.myDir));
}
Now let's say that m.items is an array. And somewhere along the line, ajax call replaces the array with a new one. I would like to keep track of this.
How can I look m.itemsor everything that was entered for the items property in the attribute? What should be the expression for the watch?
source
share