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


TypeScript core.IterableDiffers類代碼示例

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


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

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

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

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

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

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

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

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

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

示例9: getTreeControlFunctionsMissingError

 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

示例10: getTreeControlFunctionsMissingError

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