Removing TaskContent new file. Renamming it as NewTaskData and adding it into task.model file.
All checks were successful
Deploying Website / build (push) Successful in 1m3s
All checks were successful
Deploying Website / build (push) Successful in 1m3s
This commit is contained in:
parent
97d8a8ebc3
commit
c9aa8f647e
@ -5,3 +5,9 @@ export interface Task {
|
||||
summary: string;
|
||||
dueDate: string;
|
||||
}
|
||||
|
||||
export interface NewTaskData {
|
||||
title: string;
|
||||
summary: string;
|
||||
date: string;
|
||||
}
|
||||
|
@ -1,7 +1,6 @@
|
||||
import {Component, EventEmitter, Output} from '@angular/core';
|
||||
import {FormsModule} from '@angular/forms';
|
||||
import {Task} from '../../task/task.model';
|
||||
import {TaskContent} from './task-content.model';
|
||||
import {NewTaskData} from '../../task/task.model';
|
||||
|
||||
@Component({
|
||||
selector: 'app-new-task',
|
||||
@ -13,7 +12,7 @@ import {TaskContent} from './task-content.model';
|
||||
})
|
||||
export class NewTaskComponent {
|
||||
@Output() cancel = new EventEmitter<void>();
|
||||
@Output() add = new EventEmitter<TaskContent>();
|
||||
@Output() add = new EventEmitter<NewTaskData>();
|
||||
enteredTitle = '';
|
||||
enteredSummary = '';
|
||||
enteredDate = '';
|
||||
@ -23,7 +22,7 @@ export class NewTaskComponent {
|
||||
}
|
||||
|
||||
onSubmit() {
|
||||
let taskContent: TaskContent = {
|
||||
let taskContent: NewTaskData = {
|
||||
title: this.enteredTitle,
|
||||
summary: this.enteredSummary,
|
||||
date: this.enteredDate,
|
||||
|
@ -1,5 +0,0 @@
|
||||
export interface TaskContent {
|
||||
title: string;
|
||||
summary: string;
|
||||
date: string;
|
||||
}
|
@ -1,9 +1,8 @@
|
||||
import {Component, EventEmitter, Input, Output} from '@angular/core';
|
||||
import {User} from '../user/user.model';
|
||||
import {Task} from '../task/task.model';
|
||||
import {NewTaskData, Task} from '../task/task.model';
|
||||
import {TaskComponent} from '../task/task.component';
|
||||
import {NewTaskComponent} from './new-task/new-task.component';
|
||||
import {TaskContent} from './new-task/task-content.model';
|
||||
|
||||
@Component({
|
||||
selector: 'app-tasks',
|
||||
@ -56,7 +55,7 @@ export class TasksComponent {
|
||||
this.isAddingTask = false;
|
||||
}
|
||||
|
||||
onAddTask(taskContent: TaskContent) {
|
||||
onAddTask(taskContent: NewTaskData) {
|
||||
let nextTaskId = this.tasks.length + 1;
|
||||
let taskId = 't' + (nextTaskId).toString();
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user