Skip to content

Commit

Permalink
Fixed issue with "chart" directive and "type" attribute throwing an e…
Browse files Browse the repository at this point in the history
…xception and not reading in chart type

Originally, using the general "chart" directive (as opposed to a specific directive such as "linechart" or "barchart"), and the described "type" attribute caused an exception to be thrown (TypeError: undefined is not a function), and stopped the chart from being rendered at all. This was due to the fact that there was no "type" attribute defined in the directive's isolated scope. Looking at the code, it seemed as if though the chart type was expected to be specified in an attribute "chart", not an attribute "type". This "chart" attribute bound to the directive's isolated scope was changed to "type", and it no longer causes an exception to be thrown and allows the charts to be rendered as expected.

See issue gonewandering#52 (gonewandering#52) for the original reported issue.
  • Loading branch information
jstol committed Sep 18, 2014
1 parent 9dfc878 commit efbc8ad
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions angles.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ angles.chart = function (type) {
width: "=",
height: "=",
resize: "=",
chart: "@",
type: "@",
segments: "@",
responsive: "=",
tooltip: "=",
Expand Down Expand Up @@ -46,7 +46,7 @@ angles.chart = function (type) {
if (!newVal) {
return;
}
if ($scope.chart) { type = $scope.chart; }
if ($scope.type) { type = $scope.type; }

if(autosize){
$scope.size();
Expand Down

0 comments on commit efbc8ad

Please sign in to comment.