Skip to content

Instantly share code, notes, and snippets.

@GavinJoyce
Created April 4, 2016 21:03
Show Gist options
  • Save GavinJoyce/d149c504b7fb9ed30b65e4cfcca10ace to your computer and use it in GitHub Desktop.
Save GavinJoyce/d149c504b7fb9ed30b65e4cfcca10ace to your computer and use it in GitHub Desktop.
New Twiddle
import Ember from 'ember';
export default Ember.Controller.extend({
appName: 'Ember Twiddle',
placeholder: undefined,
name: undefined,
actions: {
setValues: function() {
this.setProperties({
placeholder: 'this is the placeholder',
name: 'this-name'
});
},
setUndefined: function() {
this.setProperties({
placeholder: undefined,
name: undefined
});
}
}
});
<h3>This demonstrates another possible bug with the input helper</h3>
<hr />
{{input type='text' placeholder=placeholder name=name}}
<hr />
<button {{action 'setValues'}}>1 Set values</button><br />
<button {{action 'setUndefined'}}>2 Set undefined</button>(<span style="background-color: yellow">both placeholder and name will have values of "null"</span>)
<hr />
placeholder={{placeholder}}, name={{name}}
{
"version": "0.7.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": "https://cdnjs.cloudflare.com/ajax/libs/ember.js/2.4.3/ember.debug.js",
"ember-data": "https://cdnjs.cloudflare.com/ajax/libs/ember-data.js/2.4.3/ember-data.js",
"ember-template-compiler": "https://cdnjs.cloudflare.com/ajax/libs/ember.js/2.4.3/ember-template-compiler.js"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment