Skip to content

Instantly share code, notes, and snippets.

@wojciechb
Last active August 29, 2018 12:17
Show Gist options
  • Save wojciechb/a1955c7eeee7f4a043c8f8282c1559f4 to your computer and use it in GitHub Desktop.
Save wojciechb/a1955c7eeee7f4a043c8f8282c1559f4 to your computer and use it in GitHub Desktop.
New Twiddle
import Ember from 'ember';
export default Ember.Component.extend({
test: 4,
click() {
console.log("CLICKED");
this.set('test', Math.random());
},
didReceiveAttrs() {
console.log("DID", this.get("test"));
}
});
import Ember from 'ember';
export default Ember.Controller.extend({
appName: 'Ember Twiddle',
update() {
console.log("ACTION CONTROLLER CALLED");
this.set('test', Math.random() + '-outside')
},
actions: {
update() {
console.log("ACTION CONTROLLER CALLED");
this.set('test', Math.random() + '-outside');
}
}
});
{{attributes-checker
test=appName
}}
<button action={{action 'update'}}>update</button>
{
"version": "0.15.0",
"EmberENV": {
"FEATURES": {}
},
"options": {
"use_pods": false,
"enable-testing": false
},
"dependencies": {
"jquery": "https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.js",
"ember": "3.2.2",
"ember-template-compiler": "3.2.2",
"ember-testing": "3.2.2"
},
"addons": {
"ember-data": "3.2.0"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment