typescript NG-perf2.ts

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了typescript NG-perf2.ts相关的知识,希望对你有一定的参考价值。

class Skill {
  constructor( private _id, private _name ) {}

  get id() {
    console.log('Checking id');
    return this._id;
  }

  get name() {
    console.log('Checking name');
    return this._name;
  }
}

@Component({
  template: `
    <my-select [options]="skills"></my-select>
    <button (click)="trigger()">Trigger change detection</button>
  `
})
export class AppComponent {
  skills = [ new Skill(1, 'JS'), new Skill(2, 'CSS'), new Skill(3, 'Angular') ]

  trigger() {}
}

以上是关于typescript NG-perf2.ts的主要内容,如果未能解决你的问题,请参考以下文章

typescript NG-perf7.ts

typescript NG-perf6.ts

typescript NG-perf6.ts

typescript NG-perf5.ts

typescript NG-perf4.ts

typescript NG-perf3.ts