-
Notifications
You must be signed in to change notification settings - Fork 0
0.2.0 el Content
Ivan S Glazunov edited this page Feb 20, 2015
·
7 revisions
[new] () => this;
- Provides contents and control methods contents.
- Not intended for use immediately! Only inheritance!
var Content = Templates.Content;
var instance = Content();
instance.append('1', function() { return '2'; });
instance.render(console.log); // 12
instance.content(function(callback) { callback('3'); }, '4');
instance.render(console.log); // 34
instance.append('5');
instance.prepend('0');
instance.render(console.log); // 0345
Array<TData>;
Inherited when expanding with .extend.
Contains an array is not formatted TData.
(...arguments: Array<TData>) => this;
Add TData in contents flow, before all.
(...arguments: Array<TData>) => this;
Add TData in contents flow, override all.
(...arguments: Array<TData>) => this;
Add TData in contents flow, after all.
Context for rendering from this element.
Contexts nested elements are not considered.
Method for user use.
Render the element with all contains elements and TData. After rendering the results using in Templates._stringTemplate using the argument context
merged with ._context.
(callback: TCallback) => this;
Method for internal use.
Render the element with all contains elements and TData.
- 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