-
Notifications
You must be signed in to change notification settings - Fork 0
0.1.0 proto Prototype
Ivan S Glazunov edited this page Jan 22, 2015
·
1 revision
new () => instance: Prototype
Main prototype, fix need for new
.
Set at inheritance.
data[]
Set at construct.
context[]
Set at construct.
(...context) => this
Set _context in flow.
any[]
Set at construct.
(injector?: (parent: Prototype).call(instance: Prototype) => void) => instanceof Prototype
Pass on construct.
().call(instance: Prototype) => any
Set at inheritance.
(...arguments: any[]).call(instance: Prototype) => any
Set at inheritance.
(callback: (result: string) => void) => this
Uses internal methods for rendering. Ignore context.
(callback: (result: string) => void, ...context) => this
After rendering - handle result with _.template and context.
var div = Templates.double.div, h1 = Templates.double.h1;
div('.class[alt="<%= name %>"]')(
h1()('<%= title %>')
).render(function(result) {
console.log(result);
}, { title: 'Example', name: 'semple' });
<div class="class" alt="semple"><h1>Example</h1></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