Skip to content

Instantly share code, notes, and snippets.

@jgwhite
Last active May 2, 2018 13:20
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 jgwhite/acd52cbeb2fadd57609efd31979a55a0 to your computer and use it in GitHub Desktop.
Save jgwhite/acd52cbeb2fadd57609efd31979a55a0 to your computer and use it in GitHub Desktop.
Autofocus
import Ember from 'ember';
export default Ember.Controller.extend({
appName: 'Ember Twiddle',
showForm: false
});
<button onclick={{action toggleProperty "showForm"}}>
{{if showForm "Hide" "Show"}} form
</button>
{{#if showForm}}
<form>
<label for="email">Name:</label>
<input
id="email"
type="email"
placeholder="alice@example.com"
autofocus
>
</form>
{{/if}}
{
"version": "0.13.1",
"EmberENV": {
"FEATURES": {}
},
"options": {
"use_pods": false,
"enable-testing": false
},
"dependencies": {
"jquery": "https://cdnjs.cloudflare.com/ajax/libs/jquery/1.11.3/jquery.js",
"ember": "2.16.2",
"ember-template-compiler": "2.16.2",
"ember-testing": "2.16.2"
},
"addons": {
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment