Component with custom string as template?


#1

I would like to store SVG images for my application in my API and have them delivered via API. This way i can have users create custom icons. The thing is that my SVG images need interpolation as they contain handlebar code for things like fill color, animation, etc…

Is there a way to do this using components? I’ve tried overriding the private “template” property but it doesn’t appear to do anything.


#2

There is no way to do this that is built in. Ember templates are precompiled, there isn’t even a hbs compiler shipped with the production ember build.

If you really need dynamic templates, you need to ship a compiler for a template system, or ship something other than templates (e.g. a javascript object that describes your images that you can iterate over in a template)