AngularJS and jQuery Sparklines not working in ng-repeat / directives

920 views
Skip to first unread message

m48u

unread,
Oct 15, 2012, 8:09:55 AM10/15/12
to ang...@googlegroups.com
Hi everyone,

actually I want to use jQuery Sparklines in my table using the ng-repeat directive. A static 'sparkline' is working fine but as soon as I put them into a directive they won't be displayed.
Maybe there is a timing problem because you can see in this fiddle that the sparkline is rendered but without any data. So maybe the sparklines are called before angular rendered/modified the DOM.


How could I solve this problem? Using AngularUI was a good start, but unfortunatly the same problem occurs in ng-repeat.
Would it be possible to take hands on this process with an own custom directive using the compile/linking methods? I don't have any experience on that part of directives. Is someone able to explain these functionalities for dummys? :P

Thanks in advance,
mabu

m48u

unread,
Oct 17, 2012, 9:55:43 AM10/17/12
to ang...@googlegroups.com
Hey,

I found a way to solve my problem. I don't know if I run into performance issues if there are more than just a few rows but for now it's ok.
What I did was to $observe the variables and reload them on change... anyways, have a look into this fiddle

Cheers
Reply all
Reply to author
Forward
0 new messages