Trouble with GoAngular: Page fails to update after using $set

I have a code snippet that looks like this:

$scope.renameUser = function(key,name) {
  console.log('renameUser, key: ', key);
  console.log('renameUser, name: ', name);
  var userOne = $scope.users.$key(key);
  userOne.$key('displayName').$set(name);
};

It is functional, but requires a page reload to reflect the changes. I am looking for a way to update it instantly.

While troubleshooting, I included the following code segment, however, it never seems to trigger... Any insights on what might be going wrong?

$scope.users.$on('set', opts, function(value) {
   console.log(value);
});

Answer №1

The problem arose in version 3.2.0. The $key function, when called on a model generated by either $goQuery or $goKey, was expected to return a 'new' model with a distinct key. Instead, it mistakenly reused the service linked to the initial key used.

This issue has been addressed and resolved in version 3.2.2. Updating to this latest release should rectify the problem you're facing.

We appreciate you bringing this to our attention!

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

Implement a functionality in React js where upon clicking a button, new li elements are added to

I am attempting to insert a new li element into the ul element within the CommentList return div. This li element should include the user input from the <input type="text" /> field. The error message I am encountering is: 'Cannot read ...

Creating an HTML string from an array in JavaScript

Hi there, I'm in need of some assistance with a JavaScript task. Can anyone help? I'm looking to create a JavaScript function that can take an array and return the corresponding HTML string. For example: [tagName, child1, child2, ...] • The ...

Deactivating and activating an HTML input button

So I was tinkering with this cool button: <input id="Button" type="button" value="+" style="background-color:grey" onclick="Me();"/> I've been wondering, how can I conveniently control its state of being disabled or enabled? Initially, I attem ...

Creating a spherical shape for particles using Three.js

Currently delving into the world of three.js and seeking to morph the example code below to render circular dots instead of square ones. Check out the Codepen example here. A different demonstration named canvas particle random showcases round particles, ...

I seem to be stuck on the Pokemon Damage Calculator kata on codewars. I've been trying to pass it, but I

My function seems to be working well, but I'm having trouble passing all the tests. Can anyone offer some assistance? You can find the kata at this link: function calculateDamage(yourType, opponentType, attack, defense) { let key = yourType + opp ...

jquery kwicks problem

I have been grappling with a coding problem for hours on end and I have hit a wall. Assistance is needed. On a staging page, the code was tested and found to be functioning properly. However, on the live page, the same code fails to respond as expected. I ...

Having trouble retrieving JSON data from the controller while utilizing Angular's $http method

Trying to extract information from an action in my controller. The current state of the action is as follows: def index @users = User.all respond_to do |format| format.html format.json { render json: @users } ...

What could be causing the issue with Angular JS's "ng-repeat" not functioning properly?

Presenting my owl crousal: <section id="intro"> <div class="sm-holder"> <div class="sm"> <a href="#"><i class="f ...

Handler for stack trace errors and error handling for promises

Introducing my customized error handling function: function onError(message, source, lineno, colno, error) { sendRequestToSendMail(arguments) } window.onerror = onError In addition to that, I have asynchronous tasks utilizing promises and I aim to captur ...

What is the proper way to input information into fields during an update?

Let's talk about a scenario: I have a form created using Material UI components (TextFields) that I want to use for both creating and updating products. The product creation part of the form is working well, except when no image is added. For updati ...

Look into the data with vue.js, but there's not much

1. As a newcomer to vue.js, I encountered some surprising issues while experimenting with examples. The first one arose when I assigned an id to the body tag and included the following JavaScript code: <html> <head> <meta charset="utf-8 ...

Retrieve the customized attribute from the chosen option within the datalist

Is there a way to retrieve the custom attribute "location" of an option selected from a datalist and display it? I understand that for a select element we can use selectedIndex, but how can this be achieved with datalist? <!DOCTYPE html> <html&g ...

What is the method for combining a number with a variable designation?

Hey there, I'm having some trouble changing the variable name in a loop. I attempted to use a for loop with "stop" + i, but it didn't quite work out as I had hoped. Any assistance would be greatly appreciated! ...

Having an issue loading my home state in the tree detailview application

Greetings! I am encountering an issue while attempting to refresh a section of my angular page. The setup involves a tree in the home state and a detail view in the entities state. Whenever I make updates in the detail view, I want the tree to be reloaded. ...

What causes MySQL connection to drop unexpectedly in a Node.js environment?

Currently, I am working on developing a Facebook chatbot using Node.js and have implemented a MySQL Database to store data. Everything seems to be working fine, but I have come across a query - should I be closing the database connection? I attempted to c ...

I am in search of sample cases demonstrating the process of incorporating a throbber while pages are

Is there anyone who can provide a code snippet demonstrating how to implement an animated throbber during the loading of an asp.net page? I would greatly appreciate multiple examples if possible. ...

Making API calls using JavaScript

I'm struggling with understanding how to approach this problem in javascript. Here is the question along with the details. I would appreciate any assistance. QUERY We have a server backend that provides two endpoints: /GetLocalPressReleases and /Get ...

Utilizing AngularJS to dynamically calculate and apply the width in the HTML tag using ng-style

I have a requirement to calculate the width of an element based on a scope value. I've attempted to achieve this using the following code: <div class="scene" ng-style="{ 'width': '(illustrationStyles.Width /5000) * 100' % ...

Is there a way to make io.sockets.on trigger an external or global function?

Within my Node.js application, I currently have functioning code that looks like this: var io = require('socket.io').listen(8082); io.sockets.on('connection', function (socket) { socket.on('message', function (msg) { consol ...

Unsatisfied Dependencies in NPM

Despite searching extensively on SO and across the web, I have yet to find a solution to my issue. I am in the process of creating a package of React Native components for use in various other React Native projects. The goal is for other teams to simply ad ...