Created
March 31, 2015 19:35
-
-
Save ultimatemonty/906f4114b779a9c200ef to your computer and use it in GitHub Desktop.
mx-setting.js
This file contains hidden or 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({ | |
classNames: ['row'], | |
setting: null, | |
actions: { | |
toggle: function(isToggled) { | |
this.set('setting.value', isToggled); | |
this.sendAction(); | |
}, | |
save: function() { | |
console.log(this.get('setting')); | |
this.sendAction(); | |
} | |
} | |
}); |
This file contains hidden or 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
// app/routes/engineering/settings.js | |
import Ember from 'ember'; | |
import AuthenticatedRoute from '../authenticated'; | |
export default AuthenticatedRoute.extend({ | |
beforeModel: function (transition) { | |
this._super(transition); | |
this.set('moduleName', this.controllerFor('application/header').get('activeModule')); | |
}, | |
model: function() { | |
let moduleName = this.get('moduleName'); | |
return this.store.findQuery('application-configuration', { module: 'Engineering' }); | |
}, | |
setupController: function(controller, model) { | |
console.log('MODEL'); | |
console.log(model); | |
controller.set('attrs.settings', model.content); | |
}, | |
actions: { | |
save: function(model) { | |
console.log('ROUTE:SAVE'); | |
console.log(model); | |
} | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment