diff --git a/db.json b/db.json index 4ff9d8c..74fea65 100644 --- a/db.json +++ b/db.json @@ -1,16 +1,40 @@ { "tasks": [ { - "title": "Sleeping", + "title": "configure proxy config", "completed": false, "editing": false, "id": 1 }, { - "title": "Dancing all day", + "title": "study routing", "completed": false, "editing": false, "id": 2 + }, + { + "title": "go to the gym", + "completed": false, + "editing": false, + "id": 3 + }, + { + "title": "nap for 10 mins", + "completed": false, + "editing": false, + "id": 4 + }, + { + "title": "buy milk", + "completed": false, + "editing": false, + "id": 5 + }, + { + "title": "karaoke", + "completed": false, + "editing": false, + "id": 6 } ] } \ No newline at end of file diff --git a/package.json b/package.json index c6f2c2d..459d59b 100644 --- a/package.json +++ b/package.json @@ -3,7 +3,7 @@ "version": "0.0.0", "scripts": { "ng": "ng", - "start": "ng serve", + "start": "ng serve --proxy-config proxyconfig.json", "build": "ng build", "test": "ng test", "lint": "ng lint", diff --git a/proxyconfig.json b/proxyconfig.json new file mode 100644 index 0000000..d293ec5 --- /dev/null +++ b/proxyconfig.json @@ -0,0 +1,7 @@ +{ + "/tasks":{ + "target": "http://localhost:3000", + "secure": false, + "changeOrigin": true + } +} \ No newline at end of file diff --git a/src/app/Todo-List-App/containers/TodoList/todo-list.component.html b/src/app/Todo-List-App/containers/TodoList/todo-list.component.html index 0a5f4cf..292ee15 100644 --- a/src/app/Todo-List-App/containers/TodoList/todo-list.component.html +++ b/src/app/Todo-List-App/containers/TodoList/todo-list.component.html @@ -43,7 +43,7 @@
{{ remaining()}} uncompleted tasks
- +
You've selected an item
diff --git a/src/app/Todo-List-App/containers/TodoList/todo-list.component.ts b/src/app/Todo-List-App/containers/TodoList/todo-list.component.ts index 2200dcc..1f3614f 100644 --- a/src/app/Todo-List-App/containers/TodoList/todo-list.component.ts +++ b/src/app/Todo-List-App/containers/TodoList/todo-list.component.ts @@ -124,9 +124,7 @@ export class TodoList{ this.tasks = this.tasks.filter(task => !task.completed); // this.todoService.deleteTask(tasks) - // .subscribe(data => this.tasks.filter(task => { - // return task == data; - // })) + // .subscribe(data => this.tasks.filter(task => !task.completed)) } selectAll():void{ diff --git a/src/app/Todo-List-App/services/todo.service.ts b/src/app/Todo-List-App/services/todo.service.ts index 1178731..5b8afd4 100644 --- a/src/app/Todo-List-App/services/todo.service.ts +++ b/src/app/Todo-List-App/services/todo.service.ts @@ -3,7 +3,7 @@ import { Injectable } from "@angular/core"; import { Observable } from "rxjs"; import { Tasks } from "../models/todo-interface"; import { map } from "rxjs/operators"; -const URL = 'http://localhost:3000/tasks'; +const URL = '/tasks'; @Injectable() export class TodoService{ constructor(private http: HttpClient){}