gonewandering / angles

An angular.js wrapper for Chart.js
MIT License
632 stars 87 forks source link

Angles is ignoring my options object #62

Closed trumbitta closed 9 years ago

trumbitta commented 9 years ago

I have this in the controller:

  $scope.chartData = { //omitted for brevity... }

  $scope.chartOptions = {
    animation: false,
    showScale: false
  };

and this in the view:

<canvas linechart legend="true" responsive="true" options="chartOptions" data="chartData"></canvas>

But animations are run, and the scale is shown. Any hints of what am I doing wrong?

jedrichards commented 9 years ago

Bump. I have the exact same issue.

Angles also seems to be emptying the options object too. For example if I do,

{{chartOptions}}

in my template its rendering as an empty object {}.

trumbitta commented 9 years ago

Yep @jedrichards I'm having also this (related?) issue

gonewandering commented 9 years ago

Hi guys, that's really bizarre... I'm swamped w work today, but will try to take a look first thing this wkend

adambutler commented 9 years ago

:+1: Same here

flawless2011 commented 9 years ago

Changing line 45 in angles.js from $scope.options = {}; to $scope.options = $scope.options || {}; will fix the problem.

gonewandering commented 9 years ago

@flawless2011 yeah, I was waiting till I had time to refactor this whole thing. It's a bit messy. But, I just committed your suggestion for now. Thanks. @adambutler @trumbitta @jedrichards try it now.