Skip to content

Instantly share code, notes, and snippets.

View alexspeller's full-sized avatar
🏁

Alex Speller alexspeller

🏁
View GitHub Profile
@alexspeller
alexspeller / push-deletion.js
Created May 9, 2018 22:43 — forked from runspired/push-deletion.js
Useful Ember Data helpers
/*
notifying the store that a record has been remotely deleted and should be fully removed.
*/
function pushDeletion(store, type, id) {
let record = store.peekRecord(type, id);
if (record !== null) {
let relationships = {};
let hasRelationships = false;
import Ember from 'ember';
export default Ember.Component.extend({
isFormValid: false,
childInputs: [],
actions: {
logChildViews: function() {
//do stuff
},
registerChild(component) {
import Ember from 'ember';
export default Ember.Component.extend({
click() {
this.attrs.toggleHeight();
}
});
#original attribution https://gist.github.com/alexspeller/6251054 & https://gist.github.com/stevekane/6356006
App.ClickElsewhereMixin = Ember.Mixin.create
#use this method hook to define your desired behavior
onClickElsewhere: Ember.K
#bound version of our instance method
clickHandler: Em.computed ->
Em.run.bind @, 'onClickElsewhere'
{{#object-form for=this action="formSubmitted" buttonLabel="Click Me" formClass="narrow"}}
{{form-field for="email"}}
{{form-field for="password" label="Create new password" hint="Minimum 8 characters"}}
{{form-field for="passwordConfirmation" label="Confirm new password"}}
{{/object-form}}