javascript - angular causing an error when I try to put a highcharts div on a page -
i had controller looked this
function chartcontroller($scope, $location, chart) { $scope.$on('$locationchangesuccess', function(event) { var c = chart.get({chart_name: $location.hash()}, function(data) { $scope.chart = data; }); }); }
this displayed json expected. check typeof data
returns object expected when try make div , put on page, gives me error.
function chartcontroller($scope, $location, chart) { $scope.$on('$locationchangesuccess', function(event) { var c = chart.get({chart_name: $location.hash()}, function(data) { var chart = $('<div/>').highcharts(data); $scope.chart = chart; }); }); }
this gives me following error:
typeerror: converting circular structure json @ object.stringify (native) @ tojson (http://127.0.0.1:5000/pmstats/static/lib/angular/angular.js:762:15) @ object.$get.fn (http://127.0.0.1:5000/pmstats/static/lib/angular/angular.js:4981:24) @ object.$get.scope.$digest (http://127.0.0.1:5000/pmstats/static/lib/angular/angular.js:7935:38) @ object.$get.scope.$apply (http://127.0.0.1:5000/pmstats/static/lib/angular/angular.js:8143:24) @ done (http://127.0.0.1:5000/pmstats/static/lib/angular/angular.js:9170:20) @ completerequest (http://127.0.0.1:5000/pmstats/static/lib/angular/angular.js:9333:7) @ xmlhttprequest.xhr.onreadystatechange (http://127.0.0.1:5000/pmstats/static/lib/angular/angular.js:9303:11) angular.js:5754 (anonymous function) angular.js:5754 $get angular.js:4846 $get.scope.$digest angular.js:7954 $get.scope.$apply angular.js:8143 done angular.js:9170 completerequest angular.js:9333 xhr.onreadystatechange
why error being triggered?
Comments
Post a Comment