This is probably a simple question, but I have an API that dynamically generates a PNG image, and I’m not sure how to incorporate it in an Ember app. The idea is that the user sets a bunch of parameters, clicks Submit, and the image renders. Of course, the simple way would just have this in my template:
But the images often take awhile to render (5-10sec), so I want to make use of Ember’s loading states. So is it possible to use a route’s model() to fetch the image (instead of simply generating the URL) and then insert the image data into an
<img> tag? Can I even use
ember-ajax to retrieve binary data?
My main concern in all of this is that I want a visual indicator that an image is being loaded/rendered, especially if it’s replacing an image that’s already been retrieved.