Skip to content

Instantly share code, notes, and snippets.

@makepanic
Last active December 7, 2015 20:57
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 makepanic/e175f5ad0245fc897cc8 to your computer and use it in GitHub Desktop.
Save makepanic/e175f5ad0245fc897cc8 to your computer and use it in GitHub Desktop.
New Twiddle
import Ember from 'ember';
export default Ember.Controller.extend({
appName:'Ember Twiddle'
});
<h2>yield <code>component 'link-to'</code></h2>
{{#x-show}}
{{#x-link as |yielded|}}
{{yielded.val}}
{{/x-link}}
{{/x-show}}
<hr>
<h2>yield <code>input</code></h2>
{{#x-show}}
{{#x-input as |yielded|}}
{{yielded.val maxlength=20}}
{{/x-input}}
{{/x-show}}
<hr>
<h2>yield <code>textarea</code></h2>
{{#x-show}}
{{#x-textarea as |yielded|}}
{{yielded.val rows="20"}}
{{/x-textarea}}
{{/x-show}}
<hr>
<h2>yield <code>concat</code></h2>
{{#x-show}}
{{#x-concat as |yielded|}}
{{yielded.val}}
{{/x-concat}}
{{/x-show}}
{
"version": "0.4.17",
"EmberENV": {
"FEATURES": {}
},
"dependencies": {
"jquery": "https://cdnjs.cloudflare.com/ajax/libs/jquery/1.11.3/jquery.js",
"ember": "canary",
"ember-data": "https://cdnjs.cloudflare.com/ajax/libs/ember-data.js/2.2.0/ember-data.js",
"ember-template-compiler": "canary"
}
}
{{yield (hash val=(concat 'foo' 'bar'))}}
{{yield (hash val=(input value='inputValue'))}}
import Ember from 'ember';
export default Ember.Component.extend({
shown: false,
actions: {
toggle(){
this.toggleProperty('shown');
}
}
});
<button {{action 'toggle'}}>
{{#if shown}}hide{{else}}show (run){{/if}}
</button>
{{#if shown}}
{{yield}}
{{/if}}
{{yield (hash val=(textarea value='20'))}}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment