Skip to content

Instantly share code, notes, and snippets.

@0000marcell
Created April 13, 2018 22:22
Show Gist options
  • Save 0000marcell/3e86c841e9d7ea54d4febd74b5463fb8 to your computer and use it in GitHub Desktop.
Save 0000marcell/3e86c841e9d7ea54d4febd74b5463fb8 to your computer and use it in GitHub Desktop.
New Twiddle
import Ember from 'ember';
export default Ember.Controller.extend({
showModal: Ember.computed.alias('model.showModal')
});
import Model from 'ember-data/model';
import attr from 'ember-data/attr';
import { belongsTo, hasMany } from 'ember-data/relationships';
export default Model.extend({
showModal: attr('boolean')
});
import Ember from 'ember';
import config from './config/environment';
const Router = Ember.Router.extend({
location: 'none',
rootURL: config.rootURL
});
Router.map(function() {
});
export default Router;
import Ember from 'ember';
export default Ember.Route.extend({
model(){
return this.store.createRecord('user', {
showModal: true
});
}
});
<p>Application</p>
{{#if showModal}}
<p>I'm a modal</p>
{{/if}}
{
"version": "0.13.1",
"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.16.2",
"ember-template-compiler": "2.16.2",
"ember-testing": "2.16.2"
},
"addons": {
"ember-data": "2.16.3"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment