Skip to content

Instantly share code, notes, and snippets.

@ahawkins
Created May 2, 2014 19:30
Show Gist options
  • Save ahawkins/e5471e9641614c78ac83 to your computer and use it in GitHub Desktop.
Save ahawkins/e5471e9641614c78ac83 to your computer and use it in GitHub Desktop.
App.CiruitSwitchComponent = Ember.Component.extend({
isLocked: true,
lockText: (function() {
return(this.get('isLocked') === true ? 'Unlock' : 'Lock');
}).property('isLocked')
});
<script type="text/x-handlebars" data-template-name="components/circuit-switch">
{{#if isSaving}}
<p>Saving....</p>
{{/if}}
{{input type="checkbox" name="isEnabled" checked=isEnabled disabled=isLocked}}
<a {{action "toggleLock"}} class="btn">Text: {{lockText}}</a>
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment