I have a div with a chart that's generated outside of Angular. The div is inside an ng-repeat though, and when the scope is updated, the chart is cleared. Is there a way to prevent the div with the chart from being redrawn?
Here's my HTML:
<div ng-repeat="object in objects">
<span>{{ object.title }}</span>
<div class="chart"></div> <!-- This is being cleared when object changes -->
</div>
I looked into using bindonce, but my data changes, so I can't (?) use that.
To be clear, all I'm changing is an attribute like object.title
. I don't expect the chart to stick around if the entire array of objects was replaced.
EDIT
Wrote a JSBin with the problem here: http://jsbin.com/jijalugu/1/edit?html,js,output
Looks like it's a filter that's causing the problem. I'm using the filter to split the objects into partitions (from this answer). Not sure why, it works correctly without the filter.