mirror of
https://github.com/Raghu-Ch/angular-challenges.git
synced 2026-02-12 05:43:03 -05:00
29 lines
667 B
TypeScript
29 lines
667 B
TypeScript
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;
|
|
}
|