ember install ember-deferred-content
ember-deferred-content takes the promise you need to resolve to show
your content, and yields 4 subcomponents that you can use to show
content during the different states of your promise
d.settled: displays the content when the promise is resolved or rejectedd.pending: displays the content before the promise is resolved or rejectedd.fulfilled: displays the content only when the promise is resolved; yields the result of the promised.rejected: displays the content only when the promise is rejected; yields the result of the promise
It also sets a series of flags:
d.isSettled: true if the promise is resolved or rejectedd.isPending: true until the promise is resolved or rejectedd.isFulfilled: true if the promise is resolvedd.isRejected: true if the promise is rejectedd.content: the return value of the resolved/rejected state
This addon will work on Ember versions 2.3.x and up only, due to use
of contextual
components
and the (hash helper.
git clonethis repositorynpm installbower install
npm test(Runsember try:testallto test your addon against multiple Ember versions)ember testember test --server