Ember Hooks:
didTransition
Fire on route change /ABC -> /XYZ
and model change /ABC/1 -> /ABC/2
Ember.Router.reopen({
didTransition: function() {
this._super();
//do stuff
}
// ember-runtime/lib/computed/reduce_computed_macros.js | |
// Credit to Nopik via https://github.com/emberjs/ember.js/pull/3503 | |
/* | |
var item1 = Ember.Object.create({ | |
tags: [ 'important', 'bug', 'task' ], | |
}); | |
var item2 = Ember.Object.create({ |
var gulp = require('gulp'), | |
gutil = require('gulp-util'), | |
sass = require('gulp-ruby-sass'), | |
autoprefixer = require('gulp-autoprefixer'), | |
minifycss = require('gulp-minify-css'), | |
jshint = require('gulp-jshint'), | |
uglify = require('gulp-uglify'), | |
rename = require('gulp-rename'), | |
clean = require('gulp-clean'), | |
concat = require('gulp-concat'), |
Ember Hooks:
didTransition
Fire on route change /ABC -> /XYZ
and model change /ABC/1 -> /ABC/2
Ember.Router.reopen({
didTransition: function() {
this._super();
//do stuff
}
/** | |
Ember Longpolling | |
Periodically poll to update posts with latest comments | |
*/ | |
//Create Pollster Object | |
App.Pollster = Ember.Object.extend({ | |
start: function() { | |
this.timer = setInterval(this.onPoll.bind(this), POLL_INTERVAL); | |
}, |
moduleForComponent('my-component', 'description', { | |
setup: function() { ... }, | |
teardown: function() { ... } | |
}); |
@keyframes domChanged { from { background: yellow; } } | |
@-webkit-keyframes domChanged { from { background: yellow; } } | |
.ember-view { animation: domChanged 1s; -webkit-animation: domChanged 1s; } |
// NOTE: `AppName` is simply your PascalCase application name (`modulePrefix` key from `../config/environment.js`) | |
window.AppName.__container__.lookup('service:router')._router._routerMicrolib.recognizer.names; |
I hereby claim:
To claim this, I am signing this object:
#REST+JSON API
Credit to https://stormpath.com/blog/designing-rest-json-apis/
##Behavior
PUT
and POST
can both be used for Create and Update
PUT
for Update
function toArray(args) { | |
return [].slice.call(args); | |
} | |
function sub_curry(fn /*, variable number of args */) { | |
var args = [].slice.call(arguments, 1); | |
return function () { | |
return fn.apply(this, args.concat(toArray(arguments))); | |
}; | |
} |