Each config gets called with:
var mod = require(conf.directory);
if ( conf.crud ) {
methodMixins(mod, conf);
}
app.use(mount('/api/v1', Resource(conf.name, mod).middleware()));| let currentTurn = 3; | |
| const players = [ | |
| 'you', | |
| 'someone', | |
| 'me' | |
| ]; | |
| function logCurrentPlayer () { | |
| return players[(currentTurn % players.length) - 1]; | |
| } |
| import Ember from 'ember'; | |
| export default Ember.Component.extend({ | |
| updates: Ember.A(), | |
| didReceiveAttrs () { | |
| this._super(...arguments); | |
| this.get('updates').pushObject('didReceiveAttrs ' + new Date()); | |
| }, | |
| ✓ should POST new records | |
| mocha:runner run suite Acceptance :: Resource :: Payment Method GET /payment-methods/:id +1ms | |
| GET /payment-methods/:id | |
| koa:application use responseTime +0ms | |
| koa:application use compress +0ms | |
| koa:application use bodyParser +0ms | |
| koa:application use - +0ms | |
| koa:application use dispatch +0ms | |
| koa:application use - +0ms | |
| debug: routes: bt |
Each config gets called with:
var mod = require(conf.directory);
if ( conf.crud ) {
methodMixins(mod, conf);
}
app.use(mount('/api/v1', Resource(conf.name, mod).middleware()));| function runAlongFolks ( init, iter, deviation ) { | |
| var n = init || 150, | |
| arr = []; | |
| for ( var i = 0; i < iter; i++ ) { | |
| var a = Math.floor(Math.random() * (deviation - (-deviation) + 1)) - deviation; | |
| arr.push(n); | |
| n += a; | |
| } |
| // router.js | |
| Router.map(function () { | |
| this.resource('employee', { path: 'employees/:id' }, function () { | |
| this.route('index', { path: '/' }); | |
| this.route('edit'); | |
| }); | |
| this.resource('employee.dependent', { path: 'employees/:employeeid/dependents/:dependentid' }, function () { | |
| this.route('index', { path: '/' }); | |
| this.route('edit'); |
| import Ember from 'ember'; | |
| export default Ember.Component.extend({ | |
| didInsertElement: function () { | |
| this._draw(); | |
| }, | |
| dataset: function () { | |
| // Calulate dataset | |
| return dataset; |
| export default Ember.View.extend({ | |
| didInsertElement: function () { | |
| this.$().on('scroll', { emEl: this }, this._updatePosition); | |
| }, | |
| _updatePosition: function ( ev ) { | |
| Ember.run.throttle(ev.data.emEl, function () { | |
| this.set('scrollY', ev.currentTarget.scrollY); | |
| }, 250); | |
| } |