jtblin / angular-chart.js

Reactive, responsive, beautiful charts for AngularJS using Chart.js: http://jtblin.github.io/angular-chart.js
Other
2.67k stars 759 forks source link

Nested angular-chart directive does not render if passing chart type through parent directive's attribute. #651

Closed betovidal closed 7 years ago

betovidal commented 7 years ago

Similar to #429 (directive -> directive -> chart :: Does not render).

Chart is rendered if I defined the chart type inside the directive template as "chart-line", but it does not render if I pass it through a parent directive's attribute despite being correctly added in the angular-chart's HTML.

Here's an example showing the issue: https://jsbin.com/lecebof/115/edit?html,js,output

Again, if I change class="chart {{type}}" to class="chart chart-line", chart is rendered correctly.

betovidal commented 7 years ago

Nevermind, my mistake for not reading the docs. Here's the working example: https://jsbin.com/lecebof/145/edit?html,js,output. And this guided me to the solution: https://stackoverflow.com/questions/40979975/dynamically-set-chart-type-with-angular-chart.