IceCap
IceCap provides programmable HTML templating with cheerio
.
Example:
import IceCap from 'typhonjs-ice-cap';
const ice = new IceCap('<p data-ice="name"></p>');
ice.text('name', 'Alice');
console.log(ice.html); // <p data-ice="name">Alice</p>
Static Member Summary
Static Public Members | ||
public static get |
|
|
public static get |
|
|
public static get |
|
|
public static get |
|
|
public static get |
|
|
public static get |
|
|
public static set |
debug: * |
Static Private Members | ||
private static |
_debug: * |
Constructor Summary
Public Constructor | ||
public |
constructor(html: string, options: {autoClose: boolean, autoDrop: boolean}, eventbus: EventProxy) Create instance with HTML template. |
Member Summary
Public Members | ||
public get |
autoClose: * |
|
public set |
autoClose: * |
|
public set |
autoDrop: * |
|
public get |
autoDrop: * |
|
public get |
html: * |
Private Members | ||
private |
_$root: * |
|
private |
_eventbus: * |
|
private |
_html: * |
|
private |
_options: * |
Method Summary
Public Methods | ||
public |
attr(id: *, key: *, value: *, mode: *): * |
|
public |
close(): * |
|
public |
|
|
public |
into(id: *, value: *, callback: *): * |
|
public |
load(id: *, ice: *, mode: *): * |
|
public |
loop(id: *, values: *, callback: *): * |
|
public |
Apply value to DOM that is specified with id. |
Private Methods | ||
private |
_filter(nodes: *): * |
|
private |
_nodes(id: *): * |
|
private |
_takeHTML(): * |
Static Public Members
public static set debug: * source
Static Private Members
private static _debug: * source
Public Constructors
Public Members
public get autoClose: * source
public set autoClose: * source
public set autoDrop: * source
public get autoDrop: * source
public get html: * source
Private Members
private _$root: * source
private _eventbus: * source
private _html: * source
private _options: * source
Public Methods
public attr(id: *, key: *, value: *, mode: *): * source
Params:
Name | Type | Attribute | Description |
id | * | ||
key | * | ||
value | * | ||
mode | * |
|
Return:
* |
public drop(id: *, isDrop: boolean): * source
Params:
Name | Type | Attribute | Description |
id | * | ||
isDrop | boolean |
|
Return:
* |
public into(id: *, value: *, callback: *): * source
Params:
Name | Type | Attribute | Description |
id | * | ||
value | * | ||
callback | * |
Return:
* |
public load(id: *, ice: *, mode: *): * source
Params:
Name | Type | Attribute | Description |
id | * | ||
ice | * | ||
mode | * |
|
Return:
* |
public loop(id: *, values: *, callback: *): * source
Params:
Name | Type | Attribute | Description |
id | * | ||
values | * | ||
callback | * |
Return:
* |
public text(id: string, value: string, mode: string): IceCap source
Apply value to DOM that is specified with id.