matanox
matanox

Reputation: 13686

Do d3.js and angular.js step on each other's toes?

Do d3.js and angular.js step on each other's toes, in the event management they employ for their internals?

Upvotes: 0

Views: 53

Answers (2)

Hunter Turner
Hunter Turner

Reputation: 6894

The main problem with D3.js and Angular together is the way they handle data. It is possible to use the two together by using a directive in Angular, as seen in this article:

http://www.ng-newsletter.com/posts/d3-on-angular.html.

angular.module('d3', [])
 .factory('d3Service', [function(){
  var d3;
  // insert d3 code here
 return d3;
}];

Upvotes: 0

superczan
superczan

Reputation: 306

I have used D3.js and AngularJS together. Wrapping up d3.js stuff in a custom directive worked out pretty well for me. It did create some confusion. At times, things do not work out as they are supposed to and you are left wondering why. I found this site particularly helpful:

https://www.dashingd3js.com/d3-resources/d3-and-angular

Hope this helps you in some way!

Upvotes: 1

Related Questions