everyone , Am using Angular js 1.6 and angular Chart [of chart.js] am trying to to change the type of the chart when changing the value of a HTML select input like the following but the chart type doesnt change . i found out in some FAQ that the chart needs to be destroyed and recreated again but that doesn't work with the angular version . This is my code:
The view:
<select ng-change="changeChartType(selectedType)" ng-model="selectedType" >
<option ng-repeat="t in chartType" value={{t.type}}>{{t.dispName}}</option>
</select>
<p>{{selectedType}}</p>
<div id="chartContainer">
<canvas id="doughnut" class={{selectedType}}
chart-data="data" chart-labels="labels">
</canvas>
</div>
when I use this code the class changes for example from "chart chart-pie" to "chart chart-doughnut", but the chart itself doesnt change.
Am I missing something?