Skip to content

Instantly share code, notes, and snippets.

@ef4
Forked from samselikoff/controllers.application.js
Last active June 14, 2016 20:06
Show Gist options
  • Save ef4/5c864af281825e627167751cefe5e281 to your computer and use it in GitHub Desktop.
Save ef4/5c864af281825e627167751cefe5e281 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-bind isOpen use='crossFade' growDuration=1000 as |currentlyOpen|}}
{{#if currentlyOpen}}
<p style='padding: 30px;background: whitesmoke'>
Hey there {{foo}}!
Is open is {{currentlyOpen}}
</p>
{{/if}}
{{/liquid-bind}}
{
"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