-
Notifications
You must be signed in to change notification settings - Fork 0
0.2.8 elements Content
[new] () => this;
Content > Prototype
- Provides contents and control methods contents.
- Not intended for use immediately! Only inheritance!
- For end use please use content.
var Content = Templates.Content;
var instance = Content();
instance.append('1', asSync(function() { return '2'; }));
instance.render(console.log); // 12
instance.content(asAsync(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.
(...arguments: Array<TData>) => this;
(...arguments: Array<TCallback{1}, IContext>) => TAsync(callback: (result: any) => void) => void;;
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.
Returns asynchrony TAsync that lets you embed rendering a stream.
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