This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function doThis(array, cb) { | |
| var thisArray = array; | |
| cb.apply( [{'original-array':thisArray}, {'new-array':thisArray.push(4,5,6)}] ); | |
| } | |
| var doneIt = function doneIt() { | |
| console.log(this); | |
| } | |
| doThis([1,2,3], doneIt); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var keystone = require('keystone'); | |
| exports = module.exports = function(req, res) { | |
| var view = new keystone.View(req, res), | |
| locals = res.locals; | |
| // Set locals | |
| locals.section = 'simplething'; | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var keystone = require('keystone'); | |
| /** | |
| * SimpleThing Model | |
| * ========== | |
| */ | |
| var SimpleThing = new keystone.List('SimpleThing', { | |
| map: { name: 'title' }, | |
| autokey: { path: 'slug', from: 'title', unique: true }, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var keystone = require('keystone'); | |
| exports = module.exports = function(req, res) { | |
| var view = new keystone.View(req, res), | |
| locals = res.locals; | |
| // Set locals | |
| locals.section = 'simplething'; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Import Route Controllers | |
| var routes = { | |
| views: importRoutes('./views') | |
| }; | |
| // Setup Route Bindings | |
| exports = module.exports = function(app) { | |
| app.get('/simplething', routes.views.simplething); |