Skip to content

Instantly share code, notes, and snippets.

@czosel
czosel / controllers.application.js
Last active August 22, 2023 04:29
ember-validated-form
import Ember from 'ember';
import UserValidations from 'twiddle/validations/user';
export default Ember.Controller.extend({
UserValidations,
actions: {
submit(model) {
console.log('submit', model)
model.save()
import Ember from 'ember';
import UserValidations from 'twiddle/validations/user';
export default Ember.Controller.extend({
UserValidations,
actions: {
submit(model) {
console.log('submit', model)
model.save()
import Ember from 'ember';
import UserValidations from 'twiddle/validations/user';
export default Ember.Controller.extend({
UserValidations,
actions: {
submit(model) {
console.log('submit', model)
model.save()
@czosel
czosel / controllers.application.js
Last active November 15, 2022 11:02 — forked from g8anusha/controllers.application.js
ember-validated-form custom HTML
import Ember from 'ember';
import UserValidations from 'twiddle/validations/user';
export default Ember.Controller.extend({
UserValidations,
actions: {
submit(model) {
console.log('submit', model)
model.save()
@czosel
czosel / controllers.application.js
Last active July 14, 2017 12:33
validated-form with rollback
import Ember from 'ember';
import { task, timeout } from 'ember-concurrency';
export default Ember.Controller.extend({
appName: 'Ember Twiddle',
model: {},
submit: task(function * (model) {
console.log('saving...', model);
@czosel
czosel / controllers.application.js
Last active July 23, 2017 10:22
ember-validated-form with custom textareas
import Ember from 'ember';
import UserValidations from 'twiddle/validations/user';
export default Ember.Controller.extend({
UserValidations,
model: {
firstName: '',
lastName: ''
},
@czosel
czosel / controllers.application.js
Created June 13, 2017 16:07
one-way-select with prompt and includeBlank
import Ember from 'ember';
export default Ember.Controller.extend({
appName: 'Ember Twiddle',
options: ['A', 'B', 'C']
});
@czosel
czosel / controllers.application.js
Last active July 13, 2017 14:31
one-way-select with prompt
import Ember from 'ember';
export default Ember.Controller.extend({
appName: 'Ember Twiddle',
options: ['A', 'B', 'C']
});
@czosel
czosel / components.my-form.js
Created March 28, 2017 07:04
contextual components with inbound actions
import Ember from 'ember';
export default Ember.Component.extend({
actions: {
reset() {
this.get('myInput').send('reset');
}
}
});
@czosel
czosel / controllers.application.js
Last active February 10, 2017 10:29
routing bug (triple curly bracket at top of template)
import Ember from 'ember';
export default Ember.Controller.extend({
appName: 'Ember Twiddle'
});