Created
September 17, 2015 13:30
-
-
Save sumn2u/491c8ee3abd5046e0a79 to your computer and use it in GitHub Desktop.
Select in Ember
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({ | |
// campaigns: this.store.findAll('campaigns'), | |
model: function(){ | |
return Ember.RSVP.hash({ | |
campaigns: this.store.findAll('campaigns'), | |
leads: this.store.findAll('leads') | |
}); | |
}, | |
setupController:function(controller,model){ | |
controller.set('model',model); | |
controller.set('selectedCampaign',model.campaigns.get('firstObject.id')); | |
}, | |
actions: { | |
check(){ | |
console.log("sdafhskajdfhk"); | |
console.log(this.get('controller.selectedCampaign')); | |
} | |
} | |
}); | |
/*{{view "select" | |
content = model.campaigns | |
optionLabelPath="content.name" | |
optionValuePath="content.id" | |
value=selectedCampaign | |
}} | |
<button {{action "check"}}>Go</button>*/ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment