Skip to content

Instantly share code, notes, and snippets.

@wuarmin
Last active August 16, 2016 16:36
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 wuarmin/7fa4885ae744a96155bb5e1017bf2f6f to your computer and use it in GitHub Desktop.
Save wuarmin/7fa4885ae744a96155bb5e1017bf2f6f to your computer and use it in GitHub Desktop.
inline if-conditional
import Ember from 'ember';
export default Ember.Controller.extend({
appName: 'Ember Twiddle',
prompt: 'Choose something...',
disablePrompt: true
});
body {
margin: 12px 16px;
font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
font-size: 12pt;
}
<h1>Inline If-Conditional does not work</h1>
<select>
<option {{if disablePrompt "disabled"}} selected>{{prompt}}</option>
<option>Val1</option>
<option>Val3</option>
</select>
{
"version": "0.10.4",
"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.7.0",
"ember-data": "2.7.0",
"ember-template-compiler": "2.7.0"
},
"addons": {}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment