I want to custom a directive with a json Object. When I add new key to the json object, the directive doesn't work.
Example:
props: {
node: {
attr:{}
}
},
directives:{
updAttr:{
deep: true,
update:function{
/_do something_**/
}
}
////add a key it doesn't work
node.attr['a'] = "test";
////if clone a new obj, it works
var attr = jQuery.extend(true, {}, node.attr);
attr["a"] = "test";
node.attr = attr;