Package Exports
- periodicjs.core.controller
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (periodicjs.core.controller) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
periodicjs.core.controller
Periodic's Core Controller module, provides helpful controller methods for querying documents and rendering responses.
Extensions are node modules that are loaded when an instance of periodic is instantiated.
Installation
$ npm install periodicjs.core.controllerThis is a part of Periodic's core.
Usage
Querying for tag
JavaScript
var Controller = require('periodicjs.core.controller'),
CoreController = new ControllerHelper(resources),
Tag = mongoose.model('Tag');
req.controllerData = (req.controllerData) ? req.controllerData : {};
CoreController.loadModel({
docid: 'news',
model: Tag,
population: 'contenttypes parent',
callback: function (err, doc) {
if (err) {
CoreController.handleDocumentQueryErrorResponse({
err: err,
res: res,
req: req
});
}
else {
req.controllerData.tag = doc;
next();
}
}
});##Development Make sure you have grunt installed
$ npm install -g grunt-cliThen run grunt watch
$ grunt watch##Notes
- Check out https://github.com/typesettin/periodicjs for the full Periodic Documentation