Skip to content

Instantly share code, notes, and snippets.

@hvgotcodes
hvgotcodes / controllers.application.js
Created February 16, 2018 15:40
Unload Record Oops
import Ember from 'ember';
export default Ember.Controller.extend({
appName: 'Ember Twiddle'
});
model(params) {
const stuff = this.modelFor('other.stuff');
const filter = params.filter;
return {
stuff, filter,
};
},
@hvgotcodes
hvgotcodes / controllers.application.js
Last active November 2, 2021 06:15
form-for-changesets
import Ember from 'ember';
import {
validatePresence,
validateFormat,
} from 'ember-changeset-validations/validators';
export default Ember.Controller.extend({
appName: 'Ember Twiddle',
validation: {
import Ember from 'ember';
export default Ember.Component.extend({
scope: 'inner',
actions: {
fromOuter(){},
clicked(){
console.log('clicked', this.get('scope'));
this.get('fromOuter')();
}
import Ember from 'ember';
import Chainer from 'app/components/my-chainer'
export default Chainer.extend({
first(){
console.log('subclass first', this)
}
});
In component Chainer
Ember.extend.... {
first(){},
second(){},
actions: {
chain(){
In comp-a
Ember.extend(...
didSave(){
// default implementation
}
actions: {
onSave() {
@hvgotcodes
hvgotcodes / components.my-form.js
Last active August 9, 2016 20:53
ModalsAreDifficult
import Ember from 'ember';
export default Ember.Component.extend({
});
{{#my-modal}}
{{my-form saveComplete=(action 'hideModal')}}
{{/my-modal}}
owView = hsc.ui.View.create
contentDisplayProperties: ['description']
createChildViews: (container) ->
container.left = 0
container.right = 0
container.top = 0
container.bottom = 0
@label = Ti.UI.createLabel