feat(doc): move pipe easy

This commit is contained in:
thomas
2023-10-18 10:03:06 +02:00
parent 7c52b6099f
commit 35a7f1eaa9
15 changed files with 22 additions and 22 deletions

View 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}`;
}
}