Skip to content

Instantly share code, notes, and snippets.

@samselikoff
Forked from Gaurav0/controllers.application.js
Last active June 15, 2016 07:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save samselikoff/e584714d58bd1c4569dc2f0b68f219c0 to your computer and use it in GitHub Desktop.
Save samselikoff/e584714d58bd1c4569dc2f0b68f219c0 to your computer and use it in GitHub Desktop.
Liquid Fire - child state updating
import Ember from 'ember';
export default Ember.Controller.extend({
foo: 'bar',
actions: {
toggleIsOpen() {
this.toggleProperty('isOpen');
}
}
});
import Ember from 'ember';
import config from './config/environment';
const Router = Ember.Router.extend({
location: 'none'
});
Router.map(function() {
this.route('contact');
});
export default Router;
<h1>Welcome to LF</h1>
<br>
<button {{action 'toggleIsOpen'}}>Toggle me</button>
<br>
{{#liquid-if isOpen use='crossFade' growDuration=1000}}
<p style='padding: 30px;background: whitesmoke'>
Hey there {{foo}}!
Is open is {{isOpen}}
</p>
{{/liquid-if}}
{
"version": "0.7.2",
"EmberENV": {
"FEATURES": {}
},
"addons":{
"liquid-fire":"latest",
"ember-bootstrap": "latest"
},
"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.4/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.4/ember-template-compiler.js"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment