AngularJs ui doesn't update after crud operations with NodeJs

AngularJs ui doesn't update after crud operations with NodeJs

I'm trying to build a simple CRUD app for managing employees tasks with AngularJs MongoDb ,and NodeJs. For some reason the scope variables doesn't update when doing CRUD operations, with $http requests from angular to node.

I'm trying to build a simple CRUD app for managing employees tasks with AngularJs MongoDb ,and NodeJs. For some reason the scope variables doesn't update when doing CRUD operations, with $http requests from angular to node.

First i get the Tasks list by using :

 $http.get("http://localhost:3000/employees-tasks")
    .success(function (response) {
      $scope.arrEmployeesTasks = response;
    });

Suppose i want to delete employee's task - i'm using the following functions:

AngularJs:

 $scope.deleteTask = function (prmTaskObj) {

$http.delete("http://localhost:3000/delete-task?_id=" + prmTaskObj._id).success(function (response) { console.log(response); });

Node Js

exports.delete = (req, res) => {

Tasks.findByIdAndRemove(req.query._id) .then(task => { if(!task) { return res.status(404).send({ message: "task not found with id " + req.query._id }); } res.send({message: "task deleted successfully!"}); }).catch(err => { if(err.kind === 'ObjectId' || err.name === 'NotFound') { return res.status(404).send({ message: "task not found with id " + req.query._id });
} return res.status(500).send({ message: "Could not delete task with id " + req.query._id }); }); };

It's important to add that the CRUD operations works...but i can't get the $scope.arrEmployeesTasks variable to update accordingly in the UI.

node-js angular.js

Bootstrap 5 Complete Course with Examples

Bootstrap 5 Tutorial - Bootstrap 5 Crash Course for Beginners

Nest.JS Tutorial for Beginners

Hello Vue 3: A First Look at Vue 3 and the Composition API

Building a simple Applications with Vue 3

Deno Crash Course: Explore Deno and Create a full REST API with Deno

How to Build a Real-time Chat App with Deno and WebSockets

Convert HTML to Markdown Online

HTML entity encoder decoder Online

How to Hire Node.js Developers And How Much Does It Cost?

A Guide to Hire Node.js Developers who can help you create fast and efficient web applications. Also, know how much does it cost to hire Node.js Developers.

Angular 8 Node & Express JS File Upload

In this Angular 8 and Node.js tutorial, we are going to look at how to upload files on the Node server. To create Angular image upload component, we will be using Angular 8 front-end framework along with ng2-file-upload NPM package; It’s an easy to use Angular directives for uploading the files.

Hire Node.JS Developers | Skenix Infotech

We are providing robust Node.JS Development Services with expert Node.js Developers. Get affordable Node.JS Web Development services from Skenix Infotech.

How to Implement Server Side Pagination with Angular 8 and Node.js

A simple example of how to implement server-side pagination in Angular 8 with a Node.js backend API.

Hands on with Node.Js Streams | Examples & Approach

The practical implications of having Streams in Node.js are vast. Nodejs Streams are a great way to handle data chunks and uncomplicate development.