javascript - AngularJS Directive Applying Wrong Data -
so i've written custom directive in angularjs generates highcharts graph when page loaded.
the issue i'm having is applying data of 2 separate queries in end graphs on page rather assigned one.
am missing obvious here in design?
full code: https://github.com/matt-major/swordfish
screenshot of issue: http://postimg.org/image/lf7p69q4x/
i didn't code looks passing data graph in 'render' event getting send of directives. instead of using events pass data directive through attribute. e.g.
js
app.directive('chart', function () { return { scope: { series: '=' }, link: function (scope, element) { scope.$watch('series', function (newvalue) { //render graph here } } } } html
<div chart series="ctrl.somedata"></div> also here working example in sample app made https://github.com/robianmcd/angular-stocks/blob/master/client/components/stockchartdirective.js
you can see app running @ http://angular-stocks.herokuapp.com/#/details?symbol=goog
Comments
Post a Comment