mirror of
https://github.com/Raghu-Ch/angular-challenges.git
synced 2026-02-10 21:03:03 -05:00
feat(doc): move pipe easy
This commit is contained in:
21
apps/angular/pipe-easy/src/app/app.component.ts
Normal file
21
apps/angular/pipe-easy/src/app/app.component.ts
Normal file
@@ -0,0 +1,21 @@
|
||||
import { NgFor } from '@angular/common';
|
||||
import { Component } from '@angular/core';
|
||||
|
||||
@Component({
|
||||
standalone: true,
|
||||
imports: [NgFor],
|
||||
selector: 'app-root',
|
||||
template: `
|
||||
<div *ngFor="let person of persons; let index = index">
|
||||
{{ heavyComputation(person, index) }}
|
||||
</div>
|
||||
`,
|
||||
})
|
||||
export class AppComponent {
|
||||
persons = ['toto', 'jack'];
|
||||
|
||||
heavyComputation(name: string, index: number) {
|
||||
// very heavy computation
|
||||
return `${name} - ${index}`;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user