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


TypeScript BindingEngine.propertyObserver方法代码示例

本文整理汇总了TypeScript中aurelia-framework.BindingEngine.propertyObserver方法的典型用法代码示例。如果您正苦于以下问题:TypeScript BindingEngine.propertyObserver方法的具体用法?TypeScript BindingEngine.propertyObserver怎么用?TypeScript BindingEngine.propertyObserver使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在aurelia-framework.BindingEngine的用法示例。


在下文中一共展示了BindingEngine.propertyObserver方法的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: 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

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

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

示例5: attached

 attached(){
     this.subscription = this.bindingEngine.propertyObserver(this, 'post').subscribe(this.update);
     this.update(this.post);
 }
开发者ID:cjdibbs,项目名称:Blog,代码行数:4,代码来源:disqus.ts

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


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