當前位置: 首頁>>代碼示例>>TypeScript>>正文


TypeScript fn.fn_proxy函數代碼示例

本文整理匯總了TypeScript中@utils/fn.fn_proxy函數的典型用法代碼示例。如果您正苦於以下問題:TypeScript fn_proxy函數的具體用法?TypeScript fn_proxy怎麽用?TypeScript fn_proxy使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。


在下文中一共展示了fn_proxy函數的8個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。

示例1: _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

示例2: 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

示例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;
		}
開發者ID:atmajs,項目名稱:MaskJS,代碼行數:25,代碼來源:with.ts

示例4: 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

示例5: function

    renderEnd: function(els, model, ctx, container, ctr){
        _renderPlaceholder(this, this, container);

        var fn = Boolean(this.attr.animatable)
            ? this.refreshAni
            : this.refreshSync;

        this.refresh = fn_proxy(fn, this);
        this.elements = els;

        var Ctor = this.getBinder();
        this.binder = new Ctor(this.expression, model, this);
        this.binder.bind(this.refresh);
    },
開發者ID:atmajs,項目名稱:MaskJS,代碼行數:14,代碼來源:listen.ts

示例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);
    
}
開發者ID:atmajs,項目名稱:MaskJS,代碼行數:18,代碼來源:for.ts

示例7: function

	on: function(component, events, $element?) {
		if ($element == null) {
			$element = component.$;
		}

		var isarray = events instanceof Array,
			length = isarray ? events.length : 1;

		for (var i = 0, x; isarray ? i < length : i < 1; i++) {
			x = isarray ? events[i] : events;

			if (x instanceof Array) {
				// generic jQuery .on Arguments

				if (EventDecorator != null) {
					x[0] = EventDecorator(x[0]);
				}

				$element.on.apply($element, x);
				continue;
			}


			for (var key in x) {
				var fn = typeof x[key] === 'string' ? component[x[key]] : x[key],
					semicolon = key.indexOf(':'),
					type,
					selector;

				if (semicolon !== -1) {
					type = key.substring(0, semicolon);
					selector = key.substring(semicolon + 1).trim();
				} else {
					type = key;
				}

				if (EventDecorator != null) {
					type = EventDecorator(type);
				}

				domLib_on($element, type, selector, fn_proxy(fn, component));
			}
		}
    },
開發者ID:atmajs,項目名稱:MaskJS,代碼行數:44,代碼來源:events.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


注:本文中的@utils/fn.fn_proxy函數示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。