-
Notifications
You must be signed in to change notification settings - Fork 0
0.2.7 elements Module
Ivan S Glazunov edited this page Feb 20, 2015
·
2 revisions
[new] () => Module extension;
Wraps any other type of data in the module.
Returns the successor of that same type.
var m = Module('string');
m().render(function(result) {
console.log(result); // 'string'
});var m = Module('<%= data %>');
m().render(function(result) {
console.log(result); // 'content'
}, { data: 'content' });var m = Module(div()());
m().render(function(result) {
console.log(result); // <div></div>
});var m = Module(mixin(function(a) {
return div()(a);
}));
m('data').render(function(result) {
console.log(result); // '<div>data</div>'
});- TData: Renderer|sync|async|Mixin
- TCallback: (error, result) => void
- TSelector: string
- TInjector: () => void
- TAttributes: [name: string]: TData
- TContext: TData
Node.js:
var T = require('oswst');Require.js:
define(['oswst'], function(T) {});window:
var T = window.oswst(_, async);-
Templates
- .compile
- .include
- .render
- .renderContext
- .renderAttributes
- .renderSelector
- .sync
- .isSyncFunction
- .async
- .isAsyncFunction
- .Prototype()
- .Renderer > .Prototype
- .Data > .Renderer
- .data > .Data
- .Tag > .data
- .Single > .Tag
- .singles[string]
- .Double > .Tag
- .doubles[string]
- .Doctype > .Tag
- .doctypes[string]
- .xml > .Tag
- .Mixin > .Data
- .mixin > .Mixin
- .mixins[string]
- .Module > .Renderer
- .with