Skip to content

Instantly share code, notes, and snippets.

@lolmaus
Created March 15, 2020 16:43
Show Gist options
  • Save lolmaus/93f0e2eba06eff39e625d6a98f7c03f9 to your computer and use it in GitHub Desktop.
Save lolmaus/93f0e2eba06eff39e625d6a98f7c03f9 to your computer and use it in GitHub Desktop.
Basic tracked example
import Controller from '@ember/controller';
import { tracked } from '@glimmer/tracking';
import { action } from '@ember/object';
export default class ApplicationController extends Controller {
@tracked
appName = 'Ember Twiddle';
@action
update (event) {
console.log(event)
this.appName = event.target.value;
}
}
<h1>Welcome to {{this.appName}}</h1>
<h1>Welcome to {{this.appName}}</h1>
<h1>Welcome to {{this.appName}}</h1>
<br>
<input
value={{this.appName}}
{{on "input" this.update}}
>
{
"version": "0.17.0",
"EmberENV": {
"FEATURES": {},
"_TEMPLATE_ONLY_GLIMMER_COMPONENTS": false,
"_APPLICATION_TEMPLATE_WRAPPER": true,
"_JQUERY_INTEGRATION": true
},
"options": {
"use_pods": false,
"enable-testing": false
},
"dependencies": {
"jquery": "https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.js",
"ember": "3.17.0",
"ember-template-compiler": "3.17.0",
"ember-testing": "3.17.0"
},
"addons": {
"@glimmer/component": "1.0.0"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment