Category : mongodb

This is backend code which is returning the data of array type app.get(‘/’, (req, res) => { dateModel.find((err, data) => { if (!err) { const today = new Date(); console.log(data); console.log(data[0].finalExpiryDate <= today.getDate()); res.status(200).send(data); } else { res.send(err); console.log(err); } }); }) This is service.ts file: getAllData(){ return this.http.get(this.baseUrl).pipe( map(result =>{ return <ExpiryDateModel[]>result; }) ); ..

Read more

app.component.ts Debugger given the error that this.task is undefined updateTodo(task: any){ this.todoService.updateData(task._id, this.task).subscribe(res => { this.data= res; console.log(res); console.log(this.task); }); } app.service.ts This is service file where the backend api are call in my angular app updateData(id: any , data: any){ return this.httpClient.put(‘http://localhost:3000/todos/’+id, data); } app.component.html This is the frontend of my app where the ..

Read more

Well My purpose is to use checkbox to pick a template,after that it will be added to a database but when i try to get the code of template into value it always display undefined. Interface Html Code: <input type="checkbox" id="templatepick" name="picker" value="item.templatebodyclient" (change)="displaydata($event)"> templatebody attribut have the html of our template so i tried ..

Read more

I am using jwt token with spring security tuto . After successfully generating the token on login and passing it to my angular application in localStorage object. I have one problem that on logout I delete the token but still using the same token I can hit secured api through Postman. How can i delete ..

Read more