proxy config
This commit is contained in:
parent
de41871af7
commit
247c891a09
28
db.json
28
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
|
||||
}
|
||||
]
|
||||
}
|
|
@ -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",
|
||||
|
|
|
@ -0,0 +1,7 @@
|
|||
{
|
||||
"/tasks":{
|
||||
"target": "http://localhost:3000",
|
||||
"secure": false,
|
||||
"changeOrigin": true
|
||||
}
|
||||
}
|
|
@ -43,7 +43,7 @@
|
|||
<div>{{ remaining()}} uncompleted tasks</div>
|
||||
</div>
|
||||
<div *ngIf="atleastOneCompleted()">
|
||||
<button class="btn btn-warning btn-block" (click) ="clearCompleted(); deleteCompleted(task)">Clear Completed</button>
|
||||
<button class="btn btn-warning btn-block" (click) ="clearCompleted()">Clear Completed</button>
|
||||
<div class="alert alert-warning">You've selected an item</div>
|
||||
</div>
|
||||
|
||||
|
|
|
@ -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{
|
||||
|
|
|
@ -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){}
|
||||
|
|
Loading…
Reference in New Issue