Take the 2-minute tour ×
Stack Overflow is a question and answer site for professional and enthusiast programmers. It's 100% free, no registration required.

My current problem is getting a specific set of code to run after Angular is finished binding a string of HTML with ng-bind-html. My reasons for doing this are a lot more complicated than the JSFiddle provided below (it involves calculations of SVGs) but the base principle and example of the issue can be seen there.

Does anyone know if there's another angular function I can insert code into that is guaranteed to run once ng-bind-html is finished doing what it needs to do?

I'm completely new to AngularJS so apologies if ng-bind-html is the wrong way to go about doing this when attempting to execute code once its finished. Thanks in advance.

<div class="lot" ng-bind-html="renderHtml('<span>hello</span')">

http://jsfiddle.net/wnn7uv3e/2/

share|improve this question
    
Not sure what your end goal is but if the result is DOM manipulation then you need to do that in a directive and NOT in a controller. With a directive you could simply wrap the HTML you wish to manipulate and have the directive modify it as needed in either the link or compile phases. –  mccainz 15 hours ago

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.