本文整理匯總了TypeScript中@project/observer/src/exports.expression_createBinder函數的典型用法代碼示例。如果您正苦於以下問題:TypeScript expression_createBinder函數的具體用法?TypeScript expression_createBinder怎麽用?TypeScript expression_createBinder使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。
在下文中一共展示了expression_createBinder函數的7個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。
示例1: initialize
function initialize(compo, node, index, elements, model, ctx, container, ctr) {
compo.ctx = ctx;
compo.expr = node.expression;
compo.model = model;
compo.controller = ctr;
compo.index = index;
compo.nodes = node.nodes;
compo.refresh = fn_proxy(compo.refresh, compo);
compo.binder = expression_createBinder(
compo.expr,
model,
ctx,
ctr,
compo.refresh
);
compo.Switch = new Array(node.nodes.length);
if (index != null) {
compo.Switch[index] = elements;
}
expression_bind(node.expression, model, ctx, ctr, compo.binder);
return compo;
}
示例2: _compo_initAndBind
export function _compo_initAndBind(
compo,
node,
model,
ctx,
container,
controller
) {
compo.parent = controller;
compo.model = model;
compo.ctx = ctx;
compo.refresh = fn_proxy(compo.refresh, compo);
compo.binder = expression_createBinder(
compo.expr || compo.expression,
model,
ctx,
controller,
compo.refresh
);
expression_bind(
compo.expr || compo.expression,
model,
ctx,
controller,
compo.binder
);
}
示例3: function
renderEnd: function(els, model_, ctx, container, ctr){
var model = this.rootModel || model_,
compo = new WithStatement(this);
compo.elements = els;
compo.model = model;
compo.parent = ctr;
compo.refresh = fn_proxy(compo.refresh, compo);
compo.binder = expression_createBinder(
compo.expr,
model,
ctx,
ctr,
compo.refresh
);
expression_bind(
compo.expr,
model,
ctx,
ctr,
compo.binder
);
_renderPlaceholder(this, compo, container);
return compo;
}
示例4: bind
function bind (current, expr, model, ctx, element, ctr, attrName, type){
var refresher = create_refresher(type, expr, element, current, attrName, ctr),
binder = expression_createBinder(expr, model, ctx, ctr, refresher);
expression_bind(expr, model, ctx, ctr, binder);
Component.attach(ctr, 'dispose', function(){
expression_unbind(expr, model, ctr, binder);
});
}
示例5: customAttr_register
customAttr_register('xx-visible', function(node, attrValue, model, ctx, el, ctr) {
var binder = expression_createBinder(attrValue, model, ctx, ctr, function(value){
el.style.display = value ? '' : 'none';
});
expression_bind(attrValue, model, ctx, ctr, binder);
Component.attach(ctr, 'dispose', function(){
expression_unbind(attrValue, model, ctr, binder);
});
if (expression_eval(attrValue, model, ctx, ctr, node)) {
el.style.display = 'none';
}
});
示例6: initialize
function initialize(compo, node, els, model, ctx, container, ctr) {
compo.parent = ctr;
compo.model = model;
compo.refresh = fn_proxy(compo.refresh, compo);
compo.binder = expression_createBinder(
compo.expr,
model,
ctx,
ctr,
compo.refresh
);
expression_bind(compo.expr, model, ctx, ctr, compo.binder);
}
示例7: function
renderEnd: function(els, model, ctx, container, ctr){
var compo = new VisibleStatement(this);
compo.elements = els;
compo.model = model;
compo.parent = ctr;
compo.refresh = fn_proxy(compo.refresh, compo);
compo.binder = expression_createBinder(
compo.expr,
model,
ctx,
ctr,
compo.refresh
);
expression_bind(compo.expr, model, ctx, ctr, compo.binder);
compo.refresh();
return compo;
}