Last active
August 1, 2016 19:35
-
-
Save prudvi/665ae862eb61a3bc81f553176aec3b80 to your computer and use it in GitHub Desktop.
Ember select s
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({ | |
content: null, | |
selectedValue: null, | |
lang: false, | |
actions: { | |
createBook() { | |
var title = this.get('title'); //This line works fine | |
var lang = this.get('lang'); | |
console.log(lang, title); | |
}, | |
change() { | |
const selectedEl = this.$('select')[0]; | |
const selectedIndex = selectedEl.selectedIndex; | |
const selectedValue = this.get('content')[selectedIndex]; | |
this.set('lang', selectedValue.id) | |
//this.get('targetObject').send('changeAction', selectedValue.id); | |
} | |
} | |
}); |
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.Controller.extend({ | |
appName: 'Ember Twiddle', | |
//entityID : null, | |
actions: { | |
changeAction(vale) { | |
alert('Item: '+ vale+ ': is Selected'); | |
} | |
} | |
}); |
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.Helper.helper(function([leftSide, rightSide]) { | |
return leftSide === rightSide; | |
}); |
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({ | |
model() { | |
return [{name:"ABC", id: 1}, {name:"CDE", id: 2},{name:"FGH", id: 3}]; | |
} | |
}); |
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
{ | |
"version": "0.10.1", | |
"EmberENV": { | |
"FEATURES": {} | |
}, | |
"options": { | |
"use_pods": false, | |
"enable-testing": false | |
}, | |
"dependencies": { | |
"jquery": "https://cdnjs.cloudflare.com/ajax/libs/jquery/1.11.3/jquery.js", | |
"ember": "2.6.0", | |
"ember-data": "2.6.1", | |
"ember-template-compiler": "2.6.0" | |
}, | |
"addons": {} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment