-
Notifications
You must be signed in to change notification settings - Fork 0
0.2.8 usage attributes
Ivan S Glazunov edited this page Feb 20, 2015
·
2 revisions
All tags may take arguments on the first call, in the first parentheses.
IAttributes describes the interface attributes.
Condition attributes can always be viewed and changed in ._attributes.
For ease of, all the tags available method .attributes, streaming changes.
var d = div()();
d.attributes({ key: 'value' });
console.log(d._attributes); // { key: 'value' }
When extended attributes are applied. Exception - classes, they added.
Usually, all tags can called with a attributes of the first pair of brackets.
div({ key: 'value' })().render(console.log) // <div key="value"></div>
img({ key: 'value' }).render(console.log) // <img key="value"/>
doctype.html({ key: 'value' }).render(console.log) // <!DOCTYPE html key="value"/>
- 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