Last active
September 8, 2017 19:09
-
-
Save nightire/50362d56ef9bed01ee519515b657f840 to your computer and use it in GitHub Desktop.
Changeset Playground
This file contains 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 Component from 'ember-component' | |
import Changeset from 'ember-changeset' | |
export default Component.extend({ | |
init() { | |
this._super(...arguments); | |
this.changeset = new Changeset(this.hero, this.validator) | |
console.dir(this.changeset) | |
}, | |
validator({key, newValue, oldValue, changes, content}) { | |
} | |
}) |
This file contains 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 Controller from 'ember-controller' | |
import get from 'ember-metal/get' | |
import set from 'ember-metal/set' | |
export default Controller.extend({ | |
}) |
This file contains 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 Route from 'ember-route' | |
export default Route.extend({ | |
activate() { | |
document.body.classList.add('standard') | |
} | |
}) |
This file contains 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 Route from 'ember-route' | |
import get from 'ember-metal/get' | |
import set from 'ember-metal/set' | |
class SuperHero { | |
constructor(name, age) { | |
this.name = name | |
this.age = age | |
} | |
save() { | |
return `${this.name} has been saved successfully!` | |
} | |
} | |
export default Route.extend({ | |
model() { | |
return new SuperHero('ironman', 36); | |
} | |
}) |
This file contains 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
*, *::before, &::after { | |
box-sizing: border-box; | |
} |
This file contains 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.12.1", | |
"EmberENV": { | |
"FEATURES": {} | |
}, | |
"options": { | |
"use_pods": false, | |
"enable-testing": false | |
}, | |
"dependencies": { | |
"jquery": "//cdnjs.cloudflare.com/ajax/libs/jquery/3.2.1/jquery.min.js", | |
"hack": "//cdnjs.cloudflare.com/ajax/libs/hack/0.8.0/hack.css", | |
"standard": "//cdnjs.cloudflare.com/ajax/libs/hack/0.8.0/standard.css", | |
"ember": "2.12.0", | |
"ember-template-compiler": "2.12.0", | |
"ember-testing": "2.12.0" | |
}, | |
"addons": { | |
"ember-changeset": "latest" | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment