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>
|
<app-card>
|
||||||
<article>
|
<article>
|
||||||
<h2>{{ task.title }}</h2>
|
<h2>{{ task.title }}</h2>
|
||||||
<time>Date: {{ task.dueDate }}</time>
|
<time>Date: {{ task.dueDate | date:'fullDate' }}</time>
|
||||||
<p>{{ task.summary }}</p>
|
<p>{{ task.summary }}</p>
|
||||||
<p class="actions">
|
<p class="actions">
|
||||||
<button (click)="onCompleteTask()">Complete</button>
|
<button (click)="onCompleteTask()">Complete</button>
|
||||||
|
@ -1,11 +1,13 @@
|
|||||||
import {Component, EventEmitter, Input, Output} from '@angular/core';
|
import {Component, EventEmitter, Input, Output} from '@angular/core';
|
||||||
import { Task } from './task.model';
|
import { Task } from './task.model';
|
||||||
import {CardComponent} from '../shared/card/card.component';
|
import {CardComponent} from '../shared/card/card.component';
|
||||||
|
import {DatePipe} from '@angular/common';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'app-task',
|
selector: 'app-task',
|
||||||
imports: [
|
imports: [
|
||||||
CardComponent
|
CardComponent,
|
||||||
|
DatePipe
|
||||||
],
|
],
|
||||||
templateUrl: './task.component.html',
|
templateUrl: './task.component.html',
|
||||||
styleUrl: './task.component.css'
|
styleUrl: './task.component.css'
|
||||||
|
Loading…
x
Reference in New Issue
Block a user