Closed cmadsen closed 12 years ago
FYI you can also use commonjs
Ok. I did
ddoc.sharedJS = {
stringzone : exports.myFunc = function(){return 'plankton';}
}
ddoc.lists.mylist = function(head, req) {
var xxx = require('sharedJS/stringzone').myFunc;
xxx();
But this only works if I do
ddoc.sharedJS = {
stringzone : "exports.myFunc = function(){return 'plankton';}"
}
So do I have to format my commonJS stuff as one liners to include them in app.js?
This is fine for evaluating JavaScript CommonJS code, but what about if you simply want to access an html template that was loaded using loadFiles
? Sort of what !json
does.
couchapp support two "macros" for doing server side includes. See http://guide.couchdb.org/draft/show.html
eg:
It would very convenient if there was support for this