Skip to content

Instantly share code, notes, and snippets.

View dtropp's full-sized avatar

Dan Tropp dtropp

  • Fresho
  • Sunshine Coast, Queensland, Australia
View GitHub Profile
@dtropp
dtropp / controllers.application.js
Last active February 22, 2019 05:00
push() changes object to loaded and updates relationships
import Ember from 'ember';
export default Ember.Controller.extend({
appName: 'Ember Twiddle',
actions: {
apiCallWithLila() {
this.store.push({
data: {
id: '2',
type: 'child',
@dtropp
dtropp / application.controller.js
Last active February 22, 2019 02:21 — forked from e00dan/application.controller.js
Ember data push() when some children not in payload
import Ember from 'ember';
export default Ember.Controller.extend({
appName:'Ember Twiddle'
});

Keybase proof

I hereby claim:

  • I am dtropp on github.
  • I am dantropp (https://keybase.io/dantropp) on keybase.
  • I have a public key whose fingerprint is 6724 A008 429F 980F 01D9 E965 3A7A 0BD7 C42D B477

To claim this, I am signing this object:

@dtropp
dtropp / config-detect-session-expired.coffee
Created October 26, 2015 02:22
Angular: Detect that http responses are getting 401 error and force page refresh (to prompt user to login)
angular.module('myApp').config ['$httpProvider', ($httpProvider) ->
interceptor = ['$window', '$q', ($window, $q) ->
responseError: (response) ->
if response.status == 401
$window.location.reload();
$q.reject response
else
$q.reject response
]