angular.js - How to use Angular Chart
滿天的星座
滿天的星座 2017-05-15 17:06:16
0
3
589

I use the angularjs framework automatically generated by yeoman. I want to add chart elements to my single-page application. I found a solution online: angular-chart.js (http://jtblin.github.io/angular -chart.js/).
Follow the tutorial step by step and get to
angular.module('myModule', ['chart.js']);
This step got stuck. When I wrote this in the corresponding controller, I re-run the application and found that the content on the page disappeared, that is, there was no content in the p block of ng-view, but no error was reported in the console bar. I also tried writing ['chart.js'] in app.js, but it also had no effect.
After debugging, we found that after re-running the application, we checked the scope of the corresponding controller and found that the variables labels, data, etc. in the scope were all undefined, and the code did not run into the corresponding controller at all.

滿天的星座
滿天的星座

reply all(3)
世界只因有你

Put the 'chart.js' dependency in app.js

淡淡烟草味

First check if all your files are imported, like Chart.js,angular-chart.js. I tried it myself and it works.

Ty80

I am also encountering this problem now, have you solved it?

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template