-
Notifications
You must be signed in to change notification settings - Fork 0
0.2.2 e Prototype
Ivan S Glazunov edited this page Feb 20, 2015
·
4 revisions
new () => this;
Main prototype.
- Remove need for using
new
operator. - Required use a
new
the first assembly.
var Prototype = Templates.Prototype;
var instance = new Prototype();
var Extended = instance.extend();
var extInstance = /* new */ Extended();
// ...
Set at inheritance in .extend.
Reference to prototype of this instance.
- Not intended for use immediately! Only inheritance!
IArguments;
Set at construction.
Always available arguments passed to the .constructor.
() => any;
Sets that will be returned on construction.
(...arguments: IArguments) => any;
Sets the behavior at the time of construction.
It is recommended that the first line to call the parent constructor.
div()().extend(function(parent) {
this.constructor = function() {
parent.constructor.apply(this, arguments);
};
});
What is the difference between ._parent and the parent argument in the .extend method? ._parent refers to the last parent. .extend parent argument refers to the last parent to a specific TInjector.
(injector?: TInjector) => Function;
var injector = function(parent) {
this.constructor = function() {
parent.constructor.apply(this, arguments);
};
};
div()().extend(injector);
(parent: Prototype) => void;
- 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