Skip to content

Instantly share code, notes, and snippets.

@quincyle
Last active June 1, 2016 15:42
Show Gist options
  • Save quincyle/472c6f220c19bc172af510c29826ac4d to your computer and use it in GitHub Desktop.
Save quincyle/472c6f220c19bc172af510c29826ac4d to your computer and use it in GitHub Desktop.
hello world
import Ember from 'ember';
export default Ember.Component.extend({
classNames: ['fr-button'],
onclick: Ember.on('click', function() {
this.get('onClick')()
})
});
import Ember from 'ember';
export default Ember.Component.extend({
classNames: ['fr-input'],
oninput: Ember.on('input', function(e) {
let value = e.target.value;
this.get('onInput')(value)
})
});
import Ember from 'ember';
export default Ember.Component.extend({
actions: {
inputHandler(value) {
this.set('_cachedInputVal', value)
},
clickHandler() {
alert(this.get('_cachedInputVal'))
}
}
});
import Ember from 'ember';
export default Ember.Controller.extend({
appName: 'Ember Twiddle'
});
<h1>Welcome to {{appName}}</h1>
<br>
<br>
{{outlet}}
<br>
<br>
{{fr-search}}
{{fr-input onInput=(action 'inputHandler')}}
{{fr-button onClick=(action 'clickHandler')}}
{
"version": "0.8.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.5.1",
"ember-data": "2.5.2",
"ember-template-compiler": "2.5.1"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment