Skip to content Skip to sidebar Skip to footer

AngularJS & D3 : Angular Directive For D3 Load Multiple Times

I wrote an angular directive for d3 forced-directed graph. Code is here. I use $log.log('xx'); to debug the code. I realized for some reasone this directive load multiple times. Fo

Solution 1:

Are you using an ng-repeat somewhere?
I remember realising that the link-function get´s executed multiple times for each element in the ng-repeat. So maybe in this case it´s better to use the compile function instead. Check this article: http://www.jvandemo.com/the-nitty-gritty-of-compile-and-link-functions-inside-angularjs-directives/


Post a Comment for "AngularJS & D3 : Angular Directive For D3 Load Multiple Times"