Skip to content

Instantly share code, notes, and snippets.

@teddyzeenny
Created July 18, 2013 14:07
Show Gist options
  • Save teddyzeenny/6029603 to your computer and use it in GitHub Desktop.
Save teddyzeenny/6029603 to your computer and use it in GitHub Desktop.
Ember.run.once
JP.DashboardIndexView = Ember.View.extend({
didInsertElement: function() {
this.usersChanged();
},
usersChanged: function() {
if (!this.$()) { return; } // View not in DOM
Ember.run.once(this, 'logUsers');
}.observes('controller.users.@each'),
logUsers: function() {
console.log(this.get('controller.users'));
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment