Skip to content

Commit 2194292

Browse files
revert angular changes
1 parent 253a47c commit 2194292

File tree

4 files changed

+8
-29
lines changed

4 files changed

+8
-29
lines changed

todo-frontend-app/Procfile

Whitespace-only changes.

todo-frontend-app/src/app/app-routing.module.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ import { NgModule } from '@angular/core';
22
import { Routes, RouterModule } from '@angular/router';
33

44
import { AuthGuard } from './_helpers';
5-
import {TodoListComponent} from './todo-list/todo-list.component';
65
import {HomeComponent} from './home/home.component';
76

87
const accountModule = () => import('./account/account.module').then(x => x.AccountModule);
Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,12 @@
11
<h4 class="card-title">Todo list</h4>
2-
<form [formGroup]="form" (ngSubmit)="onSubmit()">
2+
<div class="add-items d-flex">
3+
<input type="text" class="form-control todo-list-input" placeholder="What do you need to do today?" autofocus=""
4+
[(ngModel)]="newTodo.title"
5+
(keyup.enter)="addTodo()">
36

4-
<div class="add-items d-flex">
5-
<input type="text" formControlName="todoText" class="form-control todo-list-input"
6-
placeholder="What do you need to do today?" autofocus="" [(ngModel)]="newTodo.title"
7-
(keyup.enter)="addTodo()" [ngClass]="{ 'is-invalid': submitted && f.firstName.errors }">
7+
<input type="text" placeholder="Datepicker" [(ngModel)]="newTodo.dueDate" class="form-control" bsDatepicker [bsConfig]="{ isAnimated: true , dateInputFormat: 'DD-MM-YYYY'}">
88

9-
<input type="text" formControlName="dueDateText" placeholder="Datepicker" [(ngModel)]="newTodo.dueDate"
10-
class="form-control" bsDatepicker [bsConfig]="{ isAnimated: true , dateInputFormat: 'DD-MM-YYYY'}">
11-
12-
<button class="add btn btn-primary font-weight-bold todo-list-add-btn" (click)="addTodo()">Add</button>
13-
</div>
14-
</form>
9+
<button class="add btn btn-primary font-weight-bold todo-list-add-btn" (click)="addTodo()">Add</button>
10+
</div>
1511

1612

todo-frontend-app/src/app/todo-list-header/todo-list-header.component.ts

Lines changed: 1 addition & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,39 +1,23 @@
11
import { Component, OnInit, Output, EventEmitter } from '@angular/core';
22
import {Todo} from '../_models/todo';
3-
import {FormBuilder, FormGroup, Validators} from '@angular/forms';
4-
import {ActivatedRoute, Router} from '@angular/router';
5-
import {AccountService, AlertService} from '../_services';
63

74
@Component({
85
selector: 'app-todo-list-header',
96
templateUrl: './todo-list-header.component.html',
107
styleUrls: ['./todo-list-header.component.scss']
118
})
129
export class TodoListHeaderComponent implements OnInit {
13-
form: FormGroup;
1410

1511
newTodo: Todo = new Todo();
1612
dueDate: Date = new Date();
1713

1814
@Output()
1915
add: EventEmitter<Todo> = new EventEmitter();
2016

21-
22-
constructor(
23-
private formBuilder: FormBuilder,
24-
private route: ActivatedRoute,
25-
private router: Router,
26-
private accountService: AccountService,
27-
private alertService: AlertService
28-
) { }
29-
17+
constructor() { }
3018

3119
ngOnInit(): void {
3220
this.newTodo.dueDate = new Date();
33-
this.form = this.formBuilder.group({
34-
todoText: ['', Validators.required],
35-
dueDateText: ['', Validators.required]
36-
});
3721
}
3822

3923
addTodo() {

0 commit comments

Comments
 (0)