npm install && bower install
node server
grunt watch
grunt build
angular.module('d3', [])
.factory('d3Service', [function(){
var d3;
// insert d3 code here
return d3;
}];
With this factory we can add our custom code to our D3 element and inject our D3
service into our code by adding it as a dependency to our app
module
angular.module('app', ['d3']);
angular.module('myApp.directives', ['d3'])
.directive('barChart', ['d3Service', function(d3Service) {
return {
restrict: 'EA',
// directive code
}
}]);
<div d3-bars bar-height="20" bar-padding="5"></div>