Also see the discussion about global ajax settings:
Add support for a global ajaxConfig > Thus far we've just gone for having a base model and base collection in every project.
| function delegate (child) { | |
| // make it happen | |
| return function inner () { | |
| var self = this; | |
| var func = Object.getOwnPropertyNames(this).filter(function (prop) { | |
| return inner === self[prop]; | |
| }).pop(); | |
| return this[child][func].apply(this[child], arguments); |
Also see the discussion about global ajax settings:
Add support for a global ajaxConfig > Thus far we've just gone for having a base model and base collection in every project.
| var Model = require('ampersand-model'); | |
| var Foo = Model.extend({ | |
| props: { | |
| keys: { | |
| type: 'object', | |
| default: function () {return {};} | |
| } | |
| }, | |
| echo: function () { |
| // example using the raf module from npm. try changing some values! | |
| var requestAnimationFrame = require("raf") | |
| var canvas = document.createElement("canvas") | |
| canvas.width = 500 | |
| canvas.height = 500 | |
| document.body.appendChild(canvas) | |
| var context = canvas.getContext("2d") |
| lab.experiment('kittens', function () { | |
| var resultsOfAsync; | |
| lab.before(function (done) { | |
| // set the value | |
| resultsOfAsync = 'awesome stuff'; | |
| // Wait 1 second |
| var casper = require('casper').create({ | |
| viewportSize: { width: 1024, height: 768 } | |
| }); | |
| var rootUrl = 'http://drywall.herokuapp.com/'; | |
| casper.start(rootUrl, function() { | |
| this.evaluate(function(){ | |
| $('code').remove(); | |
| }); |