Skip to content

Instantly share code, notes, and snippets.

@bantic
Last active May 30, 2019 14:48
Show Gist options
  • Save bantic/9adf992fc9589faaf5b6c56d80887be1 to your computer and use it in GitHub Desktop.
Save bantic/9adf992fc9589faaf5b6c56d80887be1 to your computer and use it in GitHub Desktop.
New Twiddle
import Ember from 'ember';
export default Ember.Controller.extend({
isHidden: true
});
<h1>Example of `mut` helper (+ ember-animated)</h1>
<br>
<button onclick={{action (mut isHidden) (not isHidden)}}>
{{if isHidden "Reveal" "Hide"}}
</button>
<br>
{{#liquid-if (not isHidden) use="fade"}}
<div style='background-color: #CCC; padding: 1em;'>
<h2>Here is the expanded stuff</h2>
<p>
Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.
</p>
</div>
{{/liquid-if}}
{
"version": "0.15.1",
"EmberENV": {
"FEATURES": {}
},
"options": {
"use_pods": false,
"enable-testing": false
},
"dependencies": {
"jquery": "https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.js",
"ember": "3.4.3",
"ember-template-compiler": "3.4.3",
"ember-testing": "3.4.3"
},
"addons": {
"ember-truth-helpers": "2.1.0",
"liquid-fire": "0.29.5"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment