From 2f18c6dcde864e41e07c04c5242a0b47a45695a3 Mon Sep 17 00:00:00 2001 From: Sven Brodny Date: Fri, 16 Feb 2024 09:08:20 +0100 Subject: [PATCH] refactor(pipe-easy): update component & comments --- apps/angular/pipe-easy/src/app/app.component.ts | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/apps/angular/pipe-easy/src/app/app.component.ts b/apps/angular/pipe-easy/src/app/app.component.ts index 3c19fa1..73fef04 100644 --- a/apps/angular/pipe-easy/src/app/app.component.ts +++ b/apps/angular/pipe-easy/src/app/app.component.ts @@ -7,15 +7,16 @@ import { Component } from '@angular/core'; selector: 'app-root', template: `
- {{ heavyComputation(person, index) }} + {{ numberedPerson(person, index) }}
`, }) export class AppComponent { - persons = ['toto', 'jack']; + // TODO: untyped array? + persons = ['toto', 'jack', 'samuel', 'steve']; - heavyComputation(name: string, index: number) { - // very heavy computation - return `${name} - ${index}`; + // TODO: very heavy computation, replace this function with a pipe + numberedPerson(name: string, index: number) { + return `${index + 1}. ${name}`; } }