adopted-ember-addons / ember-cli-flash

Simple, highly configurable flash messages for ember-cli
https://www.npmjs.com/package/ember-cli-flash
MIT License
356 stars 113 forks source link

How do you add to the queue via template? #388

Open NullVoxPopuli opened 1 year ago

NullVoxPopuli commented 1 year ago

rendering a flash message via template would allow for unlimited and safe flexibility, as it would allow you to skip the service, and safely render links, not relying on htmlsafe, etc.

I noticed the README has no examples of this? can one be added?


I'm assuming somewhere in the app, there is a

{{#each fms.queue as |foo|}}
  some kind of rendering
{{/each}}

but then elsewhere, I'd like to be able to

<FlashMessage @type="success" @otherArgs={{..}} or whatever>
  My custom content
</FlashMessage>

and have this usage add to the queue, display, and do all the timeout-y stuff that folks would expect from using the service directly.