Using Pipes to transform Data. Here, the task.dueDate string into date.
All checks were successful
Deploying Website / build (push) Successful in 1m6s

This commit is contained in:
Maxime Delporte 2025-04-22 06:33:26 -03:00
parent 1e0a493bf3
commit fa12a866a0
2 changed files with 4 additions and 2 deletions

View File

@ -1,7 +1,7 @@
<app-card>
<article>
<h2>{{ task.title }}</h2>
<time>Date: {{ task.dueDate }}</time>
<time>Date: {{ task.dueDate | date:'fullDate' }}</time>
<p>{{ task.summary }}</p>
<p class="actions">
<button (click)="onCompleteTask()">Complete</button>

View File

@ -1,11 +1,13 @@
import {Component, EventEmitter, Input, Output} from '@angular/core';
import { Task } from './task.model';
import {CardComponent} from '../shared/card/card.component';
import {DatePipe} from '@angular/common';
@Component({
selector: 'app-task',
imports: [
CardComponent
CardComponent,
DatePipe
],
templateUrl: './task.component.html',
styleUrl: './task.component.css'