mirror of
https://github.com/Raghu-Ch/angular-challenges.git
synced 2026-02-12 13:53:03 -05:00
feat(challenge 35): add challenge 35 about memoization
This commit is contained in:
28
apps/performance/memoized/src/app/app.component.ts
Normal file
28
apps/performance/memoized/src/app/app.component.ts
Normal file
@@ -0,0 +1,28 @@
|
||||
import { NgIf } from '@angular/common';
|
||||
import { Component } from '@angular/core';
|
||||
import { generateList } from './generateList';
|
||||
import { PersonListComponent } from './person-list.component';
|
||||
|
||||
@Component({
|
||||
standalone: true,
|
||||
imports: [PersonListComponent, NgIf],
|
||||
selector: 'app-root',
|
||||
template: `
|
||||
<p>Performance is key!!</p>
|
||||
<button
|
||||
(click)="loadList = true"
|
||||
class="border border-black p-2 rounded-md">
|
||||
Load List
|
||||
</button>
|
||||
|
||||
<app-person-list
|
||||
*ngIf="loadList"
|
||||
class="max-w-2xl"
|
||||
[persons]="persons"
|
||||
title="Persons" />
|
||||
`,
|
||||
})
|
||||
export class AppComponent {
|
||||
persons = generateList();
|
||||
loadList = false;
|
||||
}
|
||||
Reference in New Issue
Block a user