Wednesday, April 15, 2015

Angular Html Literal Directive

Yes, this is not the way you're supposed to use Angular. There might be a better workaround out there.

I needed a way to generate image elements through Angular with custom attributes, including classes and styles. I'm working in a legacy system that makes this difficult. Can't use curly braces because we need to keep using the dead jQuery Tmpl, hasn't been phased out yet. I couldn't make the angular bindHtml directive to work. It kept on removing my style and class attributes.

So I came up with this...


No comments:

Post a Comment