当前位置: 首页>>代码示例>>TypeScript>>正文


TypeScript exports.expression_bind函数代码示例

本文整理汇总了TypeScript中@project/observer/src/exports.expression_bind函数的典型用法代码示例。如果您正苦于以下问题:TypeScript expression_bind函数的具体用法?TypeScript expression_bind怎么用?TypeScript expression_bind使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了expression_bind函数的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。

示例1: initialize

function initialize(compo, node, index, elements, model, ctx, container, ctr) {

    compo.model = model;
    compo.ctx = ctx;
    compo.controller = ctr;
    compo.refresh = fn_proxy(compo.refresh, compo);
    compo.binder = expression_createListener(compo.refresh);
    compo.index = index;
    compo.Switch = [{
        node: node,
        elements: null
    }];

    expression_bind(node.expression, model, ctx, ctr, compo.binder);

    while (true) {
        node = node.nextSibling;
        if (node == null || node.tagName !== 'else')
            break;

        compo.Switch.push({
            node: node,
            elements: null
        });

        if (node.expression)
            expression_bind(node.expression, model, ctx, ctr, compo.binder);
    }
    if (index != null) {
        compo.Switch[index].elements = elements;
    }
    return compo;
}
开发者ID:atmajs,项目名称:MaskJS,代码行数:33,代码来源:if.ts

示例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
    );
}
开发者ID:atmajs,项目名称:MaskJS,代码行数:27,代码来源:utils.ts

示例3: 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;
	}
开发者ID:atmajs,项目名称:MaskJS,代码行数:27,代码来源:switch.ts

示例4: 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;
		}
开发者ID:atmajs,项目名称:MaskJS,代码行数:25,代码来源:with.ts

示例5: 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);
    });
}
开发者ID:atmajs,项目名称:MaskJS,代码行数:10,代码来源:bind.ts

示例6: 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';
	}
});
开发者ID:atmajs,项目名称:MaskJS,代码行数:16,代码来源:xxVisible.ts

示例7: 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);
    
}
开发者ID:atmajs,项目名称:MaskJS,代码行数:18,代码来源:for.ts

示例8: 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;
		}
开发者ID:atmajs,项目名称:MaskJS,代码行数:19,代码来源:visible.ts

示例9: subscribe

 subscribe(cb: (x: T) => void, onError?: (x: Error | any) => void) {
     if (this.cbs.length === 0) {
         expression_bind(this.astNode, this.model, this.ctx, this.ctr, this.tick);
     }
     return super.subscribe(cb, onError);
 }
开发者ID:atmajs,项目名称:MaskJS,代码行数:6,代码来源:ObjectStream.ts


注:本文中的@project/observer/src/exports.expression_bind函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。