Skip to content

0.2.1 el Tag

Ivan S Glazunov edited this page Feb 20, 2015 · 2 revisions

[new] (...arguments: Array<TSelector|IAttributes>) => this;

Tag > Content > Prototype

  • Provides tags with attributes without views.

Instance

var Tag = Templates.Tag;
var tag = Tag('.class.name#id').name('div');
console.log(tag._name); // div
console.dir(tag._attributes) // { class: "class name" id: "id" }

._name

TData;

Inherited when expanding with .extend.

.name

(name: TData) => this;

Set _name option in flow.

var instance = Tag();
instance.name('div');

._attributes

IAttributes;

Contains attributes this tag.

Inherited when expanding with .extend.

All sended attributes overlap, not added. Exception - sended to the .selector classes are added, do not overlap.

.attributes

(attributes: IAttributes) => this;

Merge ._attributes with argument attributes.

.renderAttributes

(callback: TCallback) => void

Render ._attributes to string.

.selector

(selector: TSelector) => this;

Parser of selector string. Please see TSelector rules.

Uses the method of passing .parseSelector there ._attributes and argument selector.

All sended attributes overlap, not added. Exception - sended to the .selector classes are added, do not overlap.

Inherits

Clone this wiki locally