Skip to content

Instantly share code, notes, and snippets.

@elwayman02
Last active August 29, 2015 14:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save elwayman02/1fa268f4e4aa4bfc2945 to your computer and use it in GitHub Desktop.
Save elwayman02/1fa268f4e4aa4bfc2945 to your computer and use it in GitHub Desktop.
New Twiddle
export default Ember.Component.extend({
classNames: ['tharp-component'],
firstName: 'Daniel',
lastName: 'Tharp'
});
import Ember from 'ember';
export default Ember.Controller.extend({
appName:'Ember Twiddle',
amIVisible: true,
buttonText: Ember.computed('amIVisible', function () {
return this.get('amIVisible') ? 'Hide' : 'Show';
}),
actions: {
toggle() {
this.toggleProperty('amIVisible');
}
}
});
<h1>Welcome to {{appName}}</h1><br><br>
{{tharp-component}}
{{tharp-component firstName='Jordan' lastName='Hawker'}}
<button {{action 'toggle'}}>{{buttonText}} Me</button>
{{tharp-component isVisible=amIVisible firstName='Monkey'}}
<div>
My name is {{firstName}} {{lastName}}, I am awesome.
</div>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment