Here’s my situation:
- I’m binding html to a scope variable.
- I’m going string replace some text in this scope variable.
- I’m going put in some directives into this scope variable while replacing.
- When I display my scope variable as html, I want all the new directives inside to work as expected.
Solution:
I found this awesome directive to accomplish this:
1 | function dynamic ($c) { |
So here’s how my controller and html will look like:
1 | function controller($scope){ |
1 | <div class="article-contents" dynamic="content"></div> |
Hope this helps you out.