Skip to content

Instantly share code, notes, and snippets.

@n1ru4l
Created June 10, 2017 13:41
Show Gist options
  • Save n1ru4l/9d1bc231c416e09202917a74f3a6d37e to your computer and use it in GitHub Desktop.
Save n1ru4l/9d1bc231c416e09202917a74f3a6d37e to your computer and use it in GitHub Desktop.
onChange event demonstartion
import Ember from 'ember';
export default Ember.Controller.extend({
appName: 'Ember Twiddle',
model: {
sumText: 'sum text',
},
actions: {
changed() {
alert('onChange triggered')
},
test() {
console.log('shesh')
this.set('model.sumText', 'asdasdasdasdqweq')
}
},
});
<h1>Welcome to {{appName}}</h1>
<br>
<br>
{{outlet}}
<br>
{{medium-editor
model.sumText
options=(hash)
onChange=(action "changed")
}}
<button onclick={{action "test"}}>External change</button>
<br>
{
"version": "0.12.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.12.0",
"ember-template-compiler": "2.12.0",
"ember-testing": "2.12.0"
},
"addons": {
"ember-data": "2.12.1",
"ember-medium-editor": "0.1.3"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment