carlcraig/tc-angular-chartjs — pull request #4 by bostrom (2014-09-15 18:43:13+00:00)
Title: Passing unlisted chart types as-is to Chart.js

I noticed a bug/missing feature for when passing values to chart-type that aren't listed in the switch statement of cleanChartName. The current implementation tries to reference a chart function with an empty string if the type isn't found. I found this restrictive since I wouldn't be able to use the directive to create custom charts introduced by extending Chart.js with plugins.

I fixed this by letting an unknown type pass through the switch statement in cleanChartName. I also added a throw statement for when the type is missing entirely. So now when using the directive like this:

```html

```

the directive will call the MySpecialLineChart function of Chart.js, provided it's been defined.

In addition, I found the tests not to cover these cases of referencing the Chart.js instance for the type-specific functions, so I improved them to catch the case of passing unlisted types unmodified.

What do you think?