diff --git a/dist/angular_c3_simple.js b/dist/angular_c3_simple.js index 8b582a8..4a9aeb5 100644 --- a/dist/angular_c3_simple.js +++ b/dist/angular_c3_simple.js @@ -8,9 +8,9 @@ // service definition, if you want to use itm you have to include it in controller // this service allows you to access every chart by it's ID and thanks to this, // you can perform any API call available in C3.js http://c3js.org/examples.html#api - .service('c3SimpleService', function() { + .service('c3SimpleService', [function() { return {}; - }) + }]) // directive definition, if you want to use itm you have to include it in controller .directive('c3Simple', ['c3SimpleService', function(c3SimpleService) { @@ -24,7 +24,7 @@ }, template: '
', replace: true, - controller: function($scope, $element) { + controller: ['$scope','$element', function($scope, $element) { // Wait until id is set before binding chart to this id $scope.$watch($element, function() { @@ -57,7 +57,7 @@ }, true); }, true); }); - } + }] }; }]); }(c3)); diff --git a/dist/angular_c3_simple.min.js b/dist/angular_c3_simple.min.js index dd0ec43..317623b 100644 --- a/dist/angular_c3_simple.min.js +++ b/dist/angular_c3_simple.min.js @@ -1 +1 @@ -!function(c3){"use strict";angular.module("angular-c3-simple",[]).service("c3SimpleService",function(){return{}}).directive("c3Simple",["c3SimpleService",function(c3SimpleService){return{restrict:"EA",scope:{config:"="},template:"",replace:!0,controller:function($scope,$element){$scope.$watch($element,function(){""!==$element[0].id&&($scope.config.bindto="#"+$element[0].id,$scope.$watch("config",function(newConfig,oldConfig){c3SimpleService[$scope.config.bindto]=c3.generate(newConfig),newConfig.size||c3SimpleService[$scope.config.bindto].resize(),$scope.$watch("config.data",function(newData,oldData){$scope.config.bindto&&c3SimpleService[$scope.config.bindto].load(newData)},!0)},!0))})}}}])}(c3); \ No newline at end of file +!function(c3){"use strict";angular.module("angular-c3-simple",[]).service("c3SimpleService",[function(){return{}}]).directive("c3Simple",["c3SimpleService",function(c3SimpleService){return{restrict:"EA",scope:{config:"="},template:"",replace:!0,controller:["$scope","$element",function($scope,$element){$scope.$watch($element,function(){""!==$element[0].id&&($scope.config.bindto="#"+$element[0].id,$scope.$watch("config",function(newConfig,oldConfig){c3SimpleService[$scope.config.bindto]=c3.generate(newConfig),newConfig.size||c3SimpleService[$scope.config.bindto].resize(),$scope.$watch("config.data",function(newData,oldData){$scope.config.bindto&&c3SimpleService[$scope.config.bindto].load(newData)},!0)},!0))})}]}}])}(c3); \ No newline at end of file diff --git a/src/angular_c3_simple.js b/src/angular_c3_simple.js index 8b582a8..4a9aeb5 100644 --- a/src/angular_c3_simple.js +++ b/src/angular_c3_simple.js @@ -8,9 +8,9 @@ // service definition, if you want to use itm you have to include it in controller // this service allows you to access every chart by it's ID and thanks to this, // you can perform any API call available in C3.js http://c3js.org/examples.html#api - .service('c3SimpleService', function() { + .service('c3SimpleService', [function() { return {}; - }) + }]) // directive definition, if you want to use itm you have to include it in controller .directive('c3Simple', ['c3SimpleService', function(c3SimpleService) { @@ -24,7 +24,7 @@ }, template: '', replace: true, - controller: function($scope, $element) { + controller: ['$scope','$element', function($scope, $element) { // Wait until id is set before binding chart to this id $scope.$watch($element, function() { @@ -57,7 +57,7 @@ }, true); }, true); }); - } + }] }; }]); }(c3));