Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8888207
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T21:58:54+00:00 2026-06-14T21:58:54+00:00

In my Angular app, I’ve setup project as a $resource . In my controller,

  • 0

In my Angular app, I’ve setup “project” as a $resource. In my controller, I ask the server for the data over a GET request immediately when the page loads. I can edit the information in my browser using Angular’s two-way data binding, and then I can save the data back to the server via a POST request, like this:

(edited/simplified for brevity)

function ProjectCtrl($scope, $routeParams, Project) {
    $scope.project = Project.get({id: $routeParams.projectId},
        function(data) { //Successfully received data }, 
        function(data) { //Failed to receive data },
    );

    $scope.saveProject = function() {
        $scope.project.save();
    };
}

My Node server correctly receives the data, processes it and makes some changes, saves it to my database, and then responds with the newly updated “project” object via JSON. Angular does not display the new object until I refresh the page. Is there any way to make it display the new data? I’m assuming there’s a more automatic Angular way to do this than to manually call another GET request after $scope.project.save();

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-14T21:58:54+00:00Added an answer on June 14, 2026 at 9:58 pm

    It looks like the server response comes back as the first argument to the callback to save, so as long as the server responds with the full object data, you should be able to use it to create a “new” Project object like this:

    function ProjectCtrl($scope, $routeParams, Project) {
        $scope.project = Project.get({id: $routeParams.projectId},
            function(data) { /* Successfully received data */ }, 
            function(data) { /* Failed to receive data */ },
        );
    
        $scope.saveProject = function() {
            $scope.project.save(function(data) {
                $scope.project = new Project(data);
            });
        };
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm working on an app where we need to dynamically load (don't ask) angular.js
I use Angular $resource for REST service. Due to the quirk in my get
Consider the code: var app = angular.module(app, [], function($routeProvider) { $routeProvider .when(/page1, { controller:
I trying to get on my feet with angular.js using the seed app. When
I have a service: (angular .module('app.services', ['ngResource']) .factory('MyService', [ /******/ '$resource', function ($resource) {
I have the following function: var app = angular.module('Hubbub-FrontEnd', []); app.controller('DataEntryCtrl', function($scope) { $scope.entryFields
The app runs but Angular data objects are not recognized. Here is the JavaScript
How do I access hidden fields in angular? I have an app, where I
I'd like to use socketstream's RPC over websockets abstraction while using Angular for MVC.
I'm trying to create a POST request using angular.js to this Django view. class

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.