score:0
Accepted answer
The behavior is really weird. I actually created a small test code, very to the point, to test this issue. If I pass complex data type like array, json or object it works fine but somehow it doesn't work with primitive datatype like number, null or string. So what i did is, i have just replaced my two variables with one data object like:
controller
========
$scope.dataModel {
ap1: "1111"
ap2: "2222"
}
html
=======
<d3-zones
ng-if="vzones"
zone-data="vzones"
ap1-data="dataModel.ap1"
ap2-data="dataModel.ap2">
</d3-zones>
directive
========
scope: {
zoneData: '=zoneData',
ap1Data: '=ap1Data',
ap2Data: '=ap2Data'
},
And later in the link function, i am updating these two values on a particular event like this:
scope.$apply(function() {
scope.ap1Data = somevalue;
scope.ap2Data = somevalue;
});
and then passed this dataModel to the directive as given above. Now it works fine. Any change to this datModel is returned back to the controller.
Thank you guys for looking into it.
Source: stackoverflow.com
Related Query
- Return value from d3 angular directive to controller
- How to render a directive only after data is loaded from tsv in angular js
- Return value from JSON, not the children count
- How to return only unique value from array objects bound to an element in d3.js
- How to pass data from directive to controller
- d3.max doesn't return highest value from csv file
- Call Controller Function from Directive (with params passed from directive)
- D3 JavaScript return data value plus variable from anonymous function
- How to Access Angular Controller Scope from Within Embedded D3 Script
- Return individual value from a D3 color range to create legend
- How to return a value from a function, which is generated inside a callback function within?
- How to return a value from a promise which isn't a pending promise: d3.js, Javascript?
- Why is there a triangle missing from the return value of d3.voronoi.triangles?
- Passing Data to D3 from Angular directive
- d3 function(d) return value from object not from the first index(0)
- How to get maximum value from an array of objects to use in d3.scale.linear().domain()
- Using $filter in Angular directive
- how can I exclude an element from an Angular scope?
- D3.js Selecting min/max value from an array of arrays (nesting d3.extent)
- D3: Get nearest value from ordinal axis on mouseover
- d3.js - max and min value from json data which has array of values
- D3js - Getting max value from d3.line() for a specific domain
- Return multiple values from a crossfilter dimension for a pie chart
- Couldn't read path d value from d3 json file?
- d3 - Can't return data from json request?
- NVD3 Angular Directive callback firing too soon
- Return value based on max/min of another value in the same object
- Javascript: Array of dictionaries, get all key value pairs from one dictionairy with condition
- How to get value from the element using selection in d3
- How to stop Angular handling a click event from within d3
More Query from same tag
- Add labels under every bar of the grouped bar chart on D3
- Integrating D3-Chart into existing HTML site
- What do the nodes, groups, and values mean in the JSON for a d3 force-directed graph?
- Confused about SVG styling with d3.js
- Directed, acyclic graph in d3.js
- How filter using crossfilter in D3
- drawing d3.svg.arc element using data stored in array in d3.js
- How can I add a label with value to every point of the chart?
- Select top k records for each date
- Words go out of the borders in d3.js tag cloud
- Django and d3.js: CSV data
- Plot density function with 2 or 3 colored areas?
- d3 stacked area graph not working with log scale
- D3 Histogram - Date Based
- D3.js (V4) Modifying Force Directed Graph with groups as nodes
- d3.js svg image: scale from center of rectangle
- onclick() not updating slider text
- How to animate an element to follow an arc's centroid in d3?
- why does my page load super slow?(has GeoJSON and Javascript content)
- Failure rendering foreignObject inside SVG leveraging d3
- Updating the data of a pack layout from JSON call and redrawing
- remove/unbind d3 zoom from canvas
- Hard code data instead of importing data while plotting using d3 library
- How to hide the ticks for first child and last child in n3-charts
- dc.js/crossfilter chart does not select negatives correctly
- How can I get this D3.js HTML element in my AngularJS so that I can manipulate it?
- Libraries not working after implementing Webpack (SKD3)
- dc.js - Hide the div container till the svg is created
- How do I retrieve an array from a csv file in javascript using d3?
- Find the max value in a column in d3.js