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 8802981
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T01:13:16+00:00 2026-06-14T01:13:16+00:00

I jsut started learning angular.js. Can you guys show me the right way to

  • 0

I jsut started learning angular.js. Can you guys show me the right way to make a page that initially presents an ajax loader element saying ‘Loading data’ or something like that. Then after data’s been fetched it would update the view and hide the element. I can put stuff in page load event using jquery, but how do you do that using pure angular? So far I figured out how to put that in click event:

<div ng-app="VideoStatus" ng-controller="VideoStatusCtrl">
    <button ng-click="getVideos()">get videos</button>
</div>
<script type="text/javascript">
    angular.module('VideoStatus', ['ngResource']).run(function(){ 
       // I guess somehow I can start fetching data from the server here, 
      //  but I don't know how to call Controller methods passing the right scope 
    });

    function VideoStatusCtrl($scope, $resource) {
        $scope.videoStatus = $resource('/Videos/GetStatuses', { callback: 'JSON_CALLBACK' });

        $scope.getVideos = function () {
            $scope.videoResult = $scope.videoStatus.get();
            console.log('videos fetched');
        };
    };
</script>
  • 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-14T01:13:17+00:00Added an answer on June 14, 2026 at 1:13 am

    Kudos to Adam Webber & Peter Bacon Darwin

    Here is the working plunker

    Here is my version plunker that make loading as a directive with modal popup feature

    Here is the tutorial to use my version

    you only need loading.js and modal.js and reference jQuery and twitterbootstrap css.

    in your code,

    Only 2 steps you need to do with your code.

    1. Add the following code to HTML

      < div data-loading> < /div>

    2. Add LoadingModule module to your application module.

      angular.module(‘YourApp’, [‘LoadingModule’])

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a report that shows client names jsut in a list like so:
I have a page that grabs values from the query string using javascript window.location
I jsut can't set up two things side by side correctly. Help me, please
I jsut checked the sample of jQuery UI that opens a dialog, it's strange
Hi I am jsut recently learning to develop wordpress themes and at first I
I can think of a way to do this with CSS, but I rather
Alright, here's my dillema. I am making a simple application with Qt Creator that
I have a file upload script that works [finally] but want to have users
I couldn't find this anywhere, so i thought I'd ask here. Can you do
Suddenly I can't use autocomplete in my Eclipse PHP projects. When I press alt+/

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.