Last active
June 11, 2016 20:04
-
-
Save ro0gr/51d46fcbca54bc0e784ef77a127f50a0 to your computer and use it in GitHub Desktop.
dynamic page layout
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Ember from 'ember'; | |
const {set, get, computed} = Ember; | |
export default Ember.Controller.extend({ | |
appName: 'Ember Twiddle', | |
selectedGroupId: 0, | |
groups: [ | |
{label: 'first', items: ['text', 'checkbox']}, | |
{label: 'second', items: ['select', 'textarea']} | |
], | |
selectedGroup: computed('selectedGroupId', function() { | |
return this.groups[this.selectedGroupId]; | |
}), | |
actions: { | |
changeGroup: function(e) { | |
set(this, 'selectedGroupId', e.target.value); | |
} | |
} | |
}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Ember from 'ember'; | |
export function eq(params/*, hash*/) { | |
return params[0] === params[1]; | |
} | |
export default Ember.Helper.helper(eq); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
body { | |
margin: 12px 16px; | |
font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; | |
font-size: 12pt; | |
} | |
textarea, label { | |
display: block; | |
} | |
fieldset { | |
margin: 5px 0px; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"version": "0.8.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.5.1", | |
"ember-data": "2.5.2", | |
"ember-template-compiler": "2.5.1" | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment