I do not know how you insert these children, but one way to do this is:
didInsertElement: function(){ if (this.$().find(".myAwesomeChildViews").length > 0) {
The important thing is that didInsertElement () will continue to be called until the validation is true.
Even better, you can reorganize it as follows:
Ember.View.reopen({ didInsertElement: function() { this._super(); this.setIsRendered(); }, setIsRendered: function() { if (!!this.$()) { this.set('isRendered', true); } else { Ember.run.next(this, function() { this.setIsRendered(); }); } }, });
And then, in your opinion:
App.MyView = Ember.View.extend({ areMyChildViewsRendered: function() { return this.get('childViews').everyProperty('isRendered'); }.property(' chilViews.@each.isRendered ') });
source share