Skip to content

Commit cbd1715

Browse files
semagarciajtblin
authored andcommitted
Added stronger check of initial preconditions (angularjs and Chart.js), avoiding misunderstanding error message (jtblin#542)
1 parent 3ed974a commit cbd1715

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

Diff for: angular-chart.js

+4-1
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,11 @@
1010
define(['angular', 'chart'], factory);
1111
} else {
1212
// Browser globals
13-
if (typeof angular === 'undefined' || typeof Chart === 'undefined')
13+
if (typeof angular === 'undefined') {
14+
throw new Error('AngularJS framework needs to be included, see https://angularjs.org/');
15+
} else if (typeof Chart === 'undefined') {
1416
throw new Error('Chart.js library needs to be included, see http://jtblin.github.io/angular-chart.js/');
17+
}
1518
factory(angular, Chart);
1619
}
1720
}(function (angular, Chart) {

0 commit comments

Comments
 (0)