Using Pipes to transform Data. Here, the task.dueDate string into date.
All checks were successful
Deploying Website / build (push) Successful in 1m6s
All checks were successful
Deploying Website / build (push) Successful in 1m6s
This commit is contained in:
parent
1e0a493bf3
commit
fa12a866a0
@ -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>
|
||||
|
@ -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'
|
||||
|
Loading…
x
Reference in New Issue
Block a user