Last active
March 29, 2018 04:40
-
-
Save selvagsz/9b2408282701d558fe250bf23907819a to your computer and use it in GitHub Desktop.
spike
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 PRIMITIVE_INPUTS = { | |
input: 'input-field', | |
select: 'select-field', | |
} | |
const FormFor = Ember.Component.extend({ | |
init() { | |
this._super(...arguments); | |
this.publicAPI = {}; | |
this.fieldComponents = [ | |
{ | |
as: 'input', | |
component: 'input-field' | |
}, | |
]; | |
} | |
}); | |
FormFor.reopenClass({ | |
positionalParams: ['model'] | |
}) | |
export default FormFor; |
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 WrapperInput = Ember.Component.extend({ | |
init() { | |
this._super(...arguments) | |
this.test = { | |
foo: 'foo' | |
} | |
}, | |
nearestParentWithModel: Ember.computed({ | |
get() { | |
return this.nearestWithProperty('model'); | |
} | |
}), | |
value: Ember.computed('nearestParentWithModel.model', { | |
get() { | |
return this.get('nearestParentWithModel').get(`model.${this.get('property')}`) | |
}, | |
set(k, v) { | |
this.set(`nearestParentWithModel.model.${this.get('property')}`, v); | |
return v | |
} | |
}) | |
}); | |
WrapperInput.reopenClass({ | |
positionalParams: ['property'] | |
}); | |
export default WrapperInput; |
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 default Ember.Component.extend({ | |
mouseEnter() { | |
}, | |
mouseLeave() { | |
} | |
}); |
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 default Ember.Component.extend({ | |
tagName: '', | |
init() { | |
this._super(...arguments) | |
debugger; | |
} | |
}); | |
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 default Ember.Component.extend({ | |
}); |
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 default Ember.Controller.extend({ | |
appName: 'Ember Twiddle', | |
foo: { | |
name: 'Emberjs' | |
} | |
}); |
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 assignExtra(params/*, hash*/) { | |
Object.assign(params[0], params[1]); | |
} | |
export default Ember.Helper.helper(assignExtra); |
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 dynamicHash(params/*, hash*/) { | |
return { [params[0]]: params[1]}; | |
} | |
export default Ember.Helper.helper(dynamicHash); |
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 fooBar(params/*, hash*/) { | |
Object.assign(params[0].args.named, params[1]) | |
return params[0] | |
} | |
export default Ember.Helper.helper(fooBar); |
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; | |
} | |
.input-field input { | |
border-color: red; | |
} |
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.13.0", | |
"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