Last active
February 10, 2016 00:09
-
-
Save evanphx/019c90db10078f24688f to your computer and use it in GitHub Desktop.
Ember observer
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Ember from 'ember'; | |
export default Ember.Component.extend({ | |
organizations: Ember.inject.service("organizations"), | |
activeOrgChange: Ember.observer("organizations.active", function() { | |
var name = this.get("organizations.active.name"); | |
useName(name); | |
} | |
}) | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Ember from 'ember'; | |
export default Ember.Service.extend({ | |
active: null, | |
activePage: null, | |
displayTopBarNav: false, | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Ember from 'ember'; | |
export default Ember.Route.extend({ | |
organizations: Ember.inject.service("organizations"), | |
model(params) { | |
let organizations = this.get("session.currentAccount.allOrganizations"); | |
let organization = organizations.findBy('id', params.id); | |
return organization; | |
}, | |
afterModel: function(model) { | |
this.set("organizations.active", model); | |
this.get("organizations.active"); | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment