Skip to content

Instantly share code, notes, and snippets.

@KTKate
Last active August 29, 2015 14:24
Show Gist options
  • Save KTKate/2c1881ce4a8f834748fa to your computer and use it in GitHub Desktop.
Save KTKate/2c1881ce4a8f834748fa to your computer and use it in GitHub Desktop.
New Twiddle
export default Ember.Component.extend({
click: function() {
this.set('regChildCount', this.get('regChildCount') + 1);
this.attrs.mutChildCount.update(this.attrs.mutChildCount.value + 1);
this.attrs.mutChildCount.update(this.attrs.mutChildCount.value + 1);
this.attrs.mixChildCount.value = this.attrs.mixChildCount.value + 1;
}
});
mut: {{mutChildCount}}<br/>
reg: {{regChildCount}}<br/>
mix: {{mixChildCount}}
import Ember from 'ember';
export default Ember.Controller.extend({
appName:'Ember Twiddle',
controllerCount: 0
});
<h1>Welcome to {{appName}}</h1><br><br>
ctlr: {{controllerCount}}
{{child-component
regChildCount=controllerCount
mutChildCount=(mut controllerCount)
mixChildCount=(mut controllerCount)}}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment