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

  • SEARCH
  • Home
  • 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 8873679
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T18:31:33+00:00 2026-06-14T18:31:33+00:00

I have an angular js app. I am using gapi to sign in and

  • 0

I have an angular js app. I am using gapi to sign in and then call my google cloud endpoints to fetch the data. The sign in thing works fine and also it fetches the data fine from end points.

But after it fetches the data, if I assign the data to a $scope variable (which is bound to UI), it does not update the UI. There is no error even. Below is my code snippet. Any ideas?

function TestCtrl($scope){
   $scope.contactsList = [];//UI template is bound to this list
//Assuming the gapi client is already loaded
gapi.client.contactendpoint.list().execute(function(resp) {
            if (!resp.code) {
                $scope.contactsList = resp.items;//Does not update ui list
            } else {
                alert("Error, response is: "
                    + angular.toJson(resp));
            }
        });
}

Regards,
Nadeem Ullah

  • 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-14T18:31:34+00:00Added an answer on June 14, 2026 at 6:31 pm

    You need to use $apply() if you wish to update the scope from outside of the angular framework (for example from browser DOM events, setTimeout, XHR or third party libraries).
    More info available at http://docs.angularjs.org/api/ng.$rootScope.Scope.

    function TestCtrl($scope){
       $scope.contactsList = [];//UI template is bound to this list
       //Assuming the gapi client is already loaded
       gapi.client.contactendpoint.list().execute(function(resp) {
         if (!resp.code) {
    
           $scope.$apply(function(scope) {
             scope.contactsList = resp.items;
           });
    
         } else {
           alert("Error, response is: " + angular.toJson(resp));
         }
      });
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

How do I access hidden fields in angular? I have an app, where I
I have several TextBoxes, which display angular values. I format these using different custom
I have created a simple code editor using Angular JS & old fashioned JavaScript
I have a working Angular.js app with HTML5 mode enabled. $location.Html5mode(true).hashbang(!); What I want
I have a service: (angular .module('app.services', ['ngResource']) .factory('MyService', [ /******/ '$resource', function ($resource) {
I have a very strange problem with an angular app we are building. Whenever
I have a quaternion (4x1) and an angular velocity vector(3x1) and I call a
I have the following function: var app = angular.module('Hubbub-FrontEnd', []); app.controller('DataEntryCtrl', function($scope) { $scope.entryFields
Ok, so I have an Angular module working as intended on pageload - with
I am implementing a web app using angularjs (first time for me). One of

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.