Skip to content

Instantly share code, notes, and snippets.

@ErikCH
Created March 13, 2017 04:05
Show Gist options
  • Select an option

  • Save ErikCH/9099650d3605f886005cdac08e2bb166 to your computer and use it in GitHub Desktop.

Select an option

Save ErikCH/9099650d3605f886005cdac08e2bb166 to your computer and use it in GitHub Desktop.
New Twiddle
import Ember from 'ember';
export default Ember.Component.extend({
});
import Ember from 'ember';
export default Ember.Controller.extend({
init(){
this._super(...arguments);
},
appName: 'Ember Twiddle',
counter: 0,
showMessage: true,
actions:{
popup(val){
this.set('counter',this.get('counter')+val);
}
}
});
<h1>Welcome to {{appName}}</h1>
<br>
<br>
{{outlet}}
<br>
{{counter}}
<br>
{{my-component popup=(action 'popup')}}
<h3>My Component</h3>
<button {{action popup 21}}>Press Me</button>
{
"version": "0.11.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.11.0",
"ember-data": "2.11.0",
"ember-template-compiler": "2.11.0",
"ember-testing": "2.11.0"
},
"addons": {}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment