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


TypeScript IterableDiffers.find方法代码示例

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


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

示例1: ngOnChanges

 ngOnChanges(changes: SimpleChanges): void {
     if ("rawItems" in changes) {
         const currentItems = changes.rawItems.currentValue;
         if (!this._differ && currentItems) {
             this._differ = this._differs.find(currentItems).create(this._items.trackBy);
         }
     }
 }
开发者ID:beqom,项目名称:clarity,代码行数:8,代码来源:datagrid-items.ts

示例2: constructor

  constructor (private _iterableDiffers: IterableDiffers) {
    this.phrases = [];
    this.phraseClick = new EventEmitter<Phrase>();

    this.phrasesByCategory = [];

    this.m_phrasesDiffer = this._iterableDiffers.find(this.phrases).create(null);
  }
开发者ID:haestflod,项目名称:glossarytraining,代码行数:8,代码来源:phrases-selection.component.ts

示例3: ngOnChanges

 ngOnChanges(changes: SimpleChanges): void {
   // Create a new columns differ if one does not yet exist. Initialize it based on initial value
   // of the columns property.
   const columns = changes['columns'].currentValue;
   if (!this._columnsDiffer && columns) {
     this._columnsDiffer = this._differs.find(columns).create();
     this._columnsDiffer.diff(columns);
   }
 }
开发者ID:HemanthKona,项目名称:material2,代码行数:9,代码来源:row.ts

示例4: ngOnChanges

 ngOnChanges(changes: SimpleChanges): void {
   // Create a new columns differ if one does not yet exist. Initialize it based on initial value
   // of the columns property or an empty array if none is provided.
   if (!this._columnsDiffer) {
     const columns = (changes['columns'] && changes['columns'].currentValue) || [];
     this._columnsDiffer = this._differs.find(columns).create();
     this._columnsDiffer.diff(columns);
   }
 }
开发者ID:jwren,项目名称:intellij-plugins,代码行数:9,代码来源:cdk_row.ts

示例5: myDemo

	// called once on initial load
	@Input() set myDemo(items: string[]) {

		console.log("set myDemo called");

		this.items = items;
		items.forEach(item => {
			this.viewContainer.createEmbeddedView(this.templateRef);
		});
		this.differ = this.differs.find(items).create(this.changeDetector);
	}
开发者ID:training4developers,项目名称:ng2prep,代码行数:11,代码来源:demo.ts

示例6: constructor

 constructor(differs: IterableDiffers) {
   this.differ = differs.find([]).create(null);
   this.comments = [];
   this.authors = ['Elliot', 'Helen', 'Jenny', 'Joe', 'Justen', 'Matt'];
   this.texts = [
     'Ours is a life of constant reruns',
     'Really cool!',
     'Thanks!'
   ];
   // setTimeout will trigger ngDoCheck
   setTimeout(() => this.addComment(), 1000);
 }
开发者ID:screenm0nkey,项目名称:angular2-examples-webpack,代码行数:12,代码来源:lifecycle_03.ts

示例7: constructor

  constructor(differs: IterableDiffers) {
    this.differ = differs.find([]).create(null);
    this.comments = [];

    this.authors = ['Elliot', 'Helen', 'Jenny', 'Joe', 'Justen', 'Matt'];
    this.texts = [
      "Ours is a life of constant reruns. We're always circling back to where we'd we started, then starting all over again. Even if we don't run extra laps that day, we surely will come back for more of the same another day soon.",
      'Really cool!',
      'Thanks!'
    ];

    this.addComment();
  }
开发者ID:AngularLovers,项目名称:angular2,代码行数:13,代码来源:lifecycle_04.ts

示例8: ngAfterContentInit

 ngAfterContentInit() {
   this._dataDiffer = this._differs.find([]).create(this._tree.trackBy);
   if (!this._tree.treeControl.getChildren) {
     throw getTreeControlFunctionsMissingError();
   }
   this._tree.treeControl.getChildren(this.data).pipe(takeUntil(this._destroyed))
       .subscribe(result => {
         this._children = result;
         this.updateChildrenNodes();
       });
   this.nodeOutlet.changes.pipe(takeUntil(this._destroyed))
       .subscribe(() => this.updateChildrenNodes());
 }
开发者ID:davidgabrichidze,项目名称:material2,代码行数:13,代码来源:nested-node.ts

示例9: constructor

 constructor(differs: IterableDiffers) {
     this.differ = differs.find([]).create(null);
     this.comments = [];
     
     this.authors = ['Elliot', 'Helen', 'Jenny', 'Joe', 'Justen', 'Matt'];
     this.texts = [
         "I love Arsenal.", 
         "What is your name?", 
         "Awesome!"
     ];
     
     this.addComment();
 }
开发者ID:clankford,项目名称:angular2-sandbox,代码行数:13,代码来源:DoCheckComponent.ts

示例10: ngAfterContentInit

 ngAfterContentInit() {
   this._dataDiffer = this._differs.find([]).create(this._tree.trackBy);
   if (!this._tree.treeControl.getChildren) {
     throw getTreeControlFunctionsMissingError();
   }
   const childrenNodes = this._tree.treeControl.getChildren(this.data);
   if (Array.isArray(childrenNodes)) {
     this.updateChildrenNodes(childrenNodes as T[]);
   } else if (childrenNodes instanceof Observable) {
     childrenNodes.pipe(takeUntil(this._destroyed))
       .subscribe(result => this.updateChildrenNodes(result));
   }
   this.nodeOutlet.changes.pipe(takeUntil(this._destroyed))
       .subscribe(() => this.updateChildrenNodes());
 }
开发者ID:OkBayat,项目名称:material2,代码行数:15,代码来源:nested-node.ts


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