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


TypeScript aurelia-framework.BindingEngine類代碼示例

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


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

示例1: constructor

  constructor(bindingEngine: BindingEngine){
    this.name = 'Vlad';

    let subscription = bindingEngine
      .propertyObserver(this, 'name')
      .subscribe(this.nameChange);
  }
開發者ID:imressed,項目名稱:aurelia-typescript,代碼行數:7,代碼來源:home.ts

示例2: observe

 export function observe(object: any, property: string): PropertyObserver {
   if (!__ob) {
     __ob = UIUtils.lazy(BindingEngine);
   }
   return __ob.propertyObserver(object, property);
 }
開發者ID:sigmaframeworks,項目名稱:sigma-ui-framework,代碼行數:6,代碼來源:ui-event.ts

示例3: recurse

 private recurse(target, property, subscriptions, callback, path) {
     let sub = target[property];
     if (typeof sub === "object") {
         for (var p in sub)
             if (sub.hasOwnProperty(p)) {
                 this.recurse(sub, p, subscriptions, callback, `${path}${sub instanceof Array ? '[' + p + ']' : '.' + p}`);
             }
     }
     if (target != property) // Avoid re-observice root node
     {
         subscriptions.push(this._bindingEngine.propertyObserver(target, property).subscribe((n, o) => callback(n, o, path)));
     }
 };
開發者ID:t0ms3n,項目名稱:SoftwareManager,代碼行數:13,代碼來源:deep-observer.ts

示例4: observe

    public observe(target: Object, property: string, callback: (n: any, o: any, name: string) => void): () => void {
        var subscriptions: { root: any, children: any[] } = { root: null, children: [] };

        subscriptions.root = (this._bindingEngine.propertyObserver(target, property)
            .subscribe((n, o) => {
                this.disconnect(subscriptions.children);
                let path = property;
                this.recurse(target, property, subscriptions.children, callback, path);
            }
            )
        );
        return () => { this.disconnect(subscriptions.children); subscriptions.root.dispose(); }
    }
開發者ID:t0ms3n,項目名稱:SoftwareManager,代碼行數:13,代碼來源:deep-observer.ts

示例5: subscribeProperties

    subscribeProperties()
    {
        this.bindingEngine.propertyObserver(this, 'searchPhrase').subscribe((newValue, oldValue) => {
            if (newValue.length === 0) {
                this.users = [];
                return;
            }

            if (newValue.length < 3)
                return;

            this.findUsersBySearchPhrase();
        });
    }
開發者ID:GooRiOn,項目名稱:Aurora,代碼行數:14,代碼來源:project-create.ts

示例6: attached

 attached(){
     this.subscription = this.bindingEngine.propertyObserver(this, 'post').subscribe(this.update);
     this.update(this.post);
 }
開發者ID:cjdibbs,項目名稱:Blog,代碼行數:4,代碼來源:disqus.ts


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