@jsangilve Now that I see clearly what you are trying to do, I’d go one step simpler.
##Simple
controller.js
Ember.Controller.extend({
hasUserData : false,
updateUserData : function () {
var Controller = this;
this.get('data').then(function(){
Controller.set('hasUserData', true);
});
}.on('init')
});
template.hbs
{{#if hasUserData}
{{ember-chart id="overall-performance" data=data}}
{{else}}
<div class="no-chart-data">No Chart data</div>
{{/if}}
##Simplest but uses a private property
This uses a private property, but if you simply want to display the notice until the promise has resolved or rejected (e.g. ember-chart
handles rejection) then RSVP Promises have a _state
property which is null
initially, 1
on resolve, and 2
on reject.
{{#if data._result}
{{ember-chart id="overall-performance" data=data}}
{{else}}
<div class="no-chart-data">No Chart data</div>
{{/if}}
##Further Reading