Skip to content

Instantly share code, notes, and snippets.

@nickschot
Created August 27, 2020 07:09
Show Gist options
  • Save nickschot/c1f8dd7fb77e8b2e5b023f8b5244a810 to your computer and use it in GitHub Desktop.
Save nickschot/c1f8dd7fb77e8b2e5b023f8b5244a810 to your computer and use it in GitHub Desktop.
New Twiddle
import Controller from '@ember/controller';
import { tracked } from '@glimmer/tracking';
import { action } from '@ember/object';
export default class ApplicationController extends Controller {
@tracked isOpen = false;
@action
toggle() {
this.isOpen = !this.isOpen;
}
}
{{#if this.isOpen}}
{{set-body-class "is-open"}}
{{/if}}
<button type="button" {{on "click" this.toggle}}>Toggle</button>
{{outlet}}
{
"version": "0.17.1",
"EmberENV": {
"FEATURES": {},
"_TEMPLATE_ONLY_GLIMMER_COMPONENTS": true,
"_APPLICATION_TEMPLATE_WRAPPER": false,
"_JQUERY_INTEGRATION": false
},
"options": {
"use_pods": false,
"enable-testing": false
},
"dependencies": {
"ember": "3.22.0-beta.1",
"ember-template-compiler": "3.18.1",
"ember-testing": "3.18.1"
},
"addons": {
"@glimmer/component": "1.0.0",
"ember-set-body-class": "0.4.2"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment