-
Notifications
You must be signed in to change notification settings - Fork 0
0.2.2 u extend
Ivan S Glazunov edited this page Feb 20, 2015
·
3 revisions
All elements are extensions of Prototype.
Each element has the option .constructor, which you can override when inheritance. It contains the build process makes the element element.
Each element has the option .return, which specifies what will be returned by the constructor.
The extension is with the argument of the TInjector or without.
Without TInjector
var myTag = div('.myTag')().extend();
myTag()().render(console.log);
<div class="myTag"></div>
With TInjector
Here we simply disable return constructor method .content.
var injector = function(parent) {
this.return = function() { return this; };
};
var myTag = div('.myTag')().extend(injector);
myTag().render(console.log);
<div class="myTag"></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