Angularjs - watch all directive scope attributes? -
I have a "bar chart" instruction in angular, which I want to change many scope properties of one time < / P>
I am wondering what is the case with regard to the scope of my choice ...
As the render method is the only independent, the attribute has been changed, I ideally Want to see the scope for change - is this possible? I see either looking at a collection of options or a scope of all the properties. Looking at the object and looking at that object.
angular.module ('chartPackage'). Directive ('Barchart', '[Function () {return {restrict:' E ', scope: {width:' = ', height:' = ', fontSize:' = ', Data:' = ', colorMap:' = ', OnClick:' = ', transit:' = ',}, link: function (scope, element, etter) {// How to view all attributes? Field. $ Watch (' ?????? ', Function (A, B) {Recker ();}
You provided the watch expression
scope. $ Watch (function (newview, oldview) {console.log (newValue.width);});
Comments
Post a Comment