From 7cadcc1cf6795d17dd627e11b4b3ebba15c6fd67 Mon Sep 17 00:00:00 2001 From: Timothy Alcaide Date: Wed, 10 Apr 2024 21:06:29 +0200 Subject: [PATCH] refactor: review fix --- apps/angular/dialog-alert-form/src/app/app.config.ts | 4 ++-- .../dialog-alert-form/src/app/pages/page.component.ts | 7 ++----- docs/src/content/authors/timothy-alcaide.json | 7 +++++++ .../docs/challenges/angular/48-dialog-alert-form.md | 8 ++------ 4 files changed, 13 insertions(+), 13 deletions(-) create mode 100644 docs/src/content/authors/timothy-alcaide.json diff --git a/apps/angular/dialog-alert-form/src/app/app.config.ts b/apps/angular/dialog-alert-form/src/app/app.config.ts index ed40494..a7c1007 100644 --- a/apps/angular/dialog-alert-form/src/app/app.config.ts +++ b/apps/angular/dialog-alert-form/src/app/app.config.ts @@ -1,7 +1,7 @@ import { ApplicationConfig } from '@angular/core'; -import { provideRouter } from '@angular/router'; +import { provideRouter, withComponentInputBinding } from '@angular/router'; import { appRoutes } from './app.routes'; export const appConfig: ApplicationConfig = { - providers: [provideRouter(appRoutes)], + providers: [provideRouter(appRoutes, withComponentInputBinding())], }; diff --git a/apps/angular/dialog-alert-form/src/app/pages/page.component.ts b/apps/angular/dialog-alert-form/src/app/pages/page.component.ts index 668b74b..13f4e09 100644 --- a/apps/angular/dialog-alert-form/src/app/pages/page.component.ts +++ b/apps/angular/dialog-alert-form/src/app/pages/page.component.ts @@ -1,7 +1,4 @@ -import { ChangeDetectionStrategy, Component, inject } from '@angular/core'; -import { toSignal } from '@angular/core/rxjs-interop'; -import { ActivatedRoute } from '@angular/router'; -import { map } from 'rxjs'; +import { ChangeDetectionStrategy, Component, input } from '@angular/core'; @Component({ standalone: true, @@ -13,5 +10,5 @@ import { map } from 'rxjs'; changeDetection: ChangeDetectionStrategy.OnPush, }) export class PageComponent { - title = toSignal(inject(ActivatedRoute).data.pipe(map((d) => d['title']))); + title = input.required(); } diff --git a/docs/src/content/authors/timothy-alcaide.json b/docs/src/content/authors/timothy-alcaide.json new file mode 100644 index 0000000..a50cd76 --- /dev/null +++ b/docs/src/content/authors/timothy-alcaide.json @@ -0,0 +1,7 @@ +{ + "name": "Timothy Alcaide", + "github": "https://github.com/alcaidio", + "youtube": "https://www.youtube.com/@timothyalcaide", + "twitter": "https://twitter.com/alcaidio", + "linkedin": "https://www.linkedin.com/in/timothyalcaide" +} diff --git a/docs/src/content/docs/challenges/angular/48-dialog-alert-form.md b/docs/src/content/docs/challenges/angular/48-dialog-alert-form.md index ec8ab85..473dded 100644 --- a/docs/src/content/docs/challenges/angular/48-dialog-alert-form.md +++ b/docs/src/content/docs/challenges/angular/48-dialog-alert-form.md @@ -1,9 +1,9 @@ --- title: 🟠 Save your form's bacon: with the navigation alert description: Challenge 48 is about Bob 🧙‍♂️ the product owner, he wants to develop a new feature in response to customer complaints about losing form input information. -author: Timothy Alcaide +author: timothy-alcaide contributors: - - tomalaforge + - Timothy Alcaide challengeNumber: 48 command: angular-dialog-alert-form sidebar: @@ -11,10 +11,6 @@ sidebar: badge: New --- -:::note -WIP: The following documentation need to be written. -::: - ## Context As a member of the development team, you need to address a specific request from the product owner, Bob 🧙‍♂️ He wants to develop a new feature in response to customer complaints about losing form input information.