How can we display message when we click some element(button) that server is loading?

0 votes
I had a web page that contain sum button. So when i click on that button the message "is loading " should be displayed. How to do that?
Feb 11 in Angular by kartik
• 10,760 points
185 views

1 answer to this question.

0 votes

hey kartik,

 As $route is used for deep-linking URLs to controllers and views (HTML partials). It watches $location.url() and tries to map the path to an existing route definition.

Requires the ngRoute module to be installed.

You can define routes through $routeProvider's API.

The $route service is typically used in combined with the ngView directive and the $routeParam service.

So you can add $scope.isLoading="true" statement to identify that you make a request to web server and display message as you want.  Example mark up code to display message is given below:

<div ng-show=" isLoading=="true">
         <span> Loading......please wait...........</span>
</div>

<div ng-show="isLoading=="false">
       Sum result={{ result}}

</div>

From above it is seen that if isLoading is true means you had make a request so it display the meassage and after completing the request it displayed the result.

[Note]: IsLoading condition true and false should be placed before and after of the controller of the sum.

answered Feb 11 by Niroj
• 21,680 points

Related Questions In Angular

0 votes
1 answer

How can we achieve transclusion using link function and directive controller?

Hey, The Term Transclusion means unhidding the context ...READ MORE

answered Feb 5 in Angular by Niroj
• 21,680 points
46 views
0 votes
1 answer

How can we redirect to an existing route using ngRoute?

Routing is just another way of fixing some content ...READ MORE

answered Feb 6 in Angular by Niroj
• 21,680 points
90 views
0 votes
1 answer

How can we redirect to another page from existing page on clicking alert?

hii, It is really simple to redirect from ...READ MORE

answered Feb 6 in Angular by Niroj
• 21,680 points
147 views
0 votes
1 answer

How can we reload a page after requesting the same get parameter using AngularJS?

hey kartik, The reason for this is that ...READ MORE

answered Feb 10 in Angular by Niroj
• 21,680 points
606 views
+1 vote
1 answer

What is the relationship between angularjs Scope with controller/view?

Let us consider the below block: <div ng-controller="emp"> ...READ MORE

answered Jan 20 in Web Development by Niroj
• 21,680 points

edited Jan 21 by Niroj 67 views
+1 vote
1 answer

What is css box module?

Hey, All the element present in html follows ...READ MORE

answered Jan 20 in Web Development by Niroj
• 21,680 points

edited Jan 21 by Niroj 53 views
0 votes
1 answer

Explain the difference between visibility:hidden; and display:none?

hii, visibility:hidden; and display:none are totally different used ...READ MORE

answered Jan 20 in Web Development by Niroj
• 21,680 points
349 views
+1 vote
1 answer

How to access the Angularjs scope of a particular html element from our console?

Hello, You should follow the below steps:-- 1.Compile and ...READ MORE

answered Jan 21 in Web Development by Niroj
• 21,680 points

edited Jan 21 by Niroj 52 views
0 votes
1 answer

How can we go back to previous page after having some error on request made through current page ?

$route is used for deep-linking URLs to controllers ...READ MORE

answered Feb 11 in Angular by Niroj
• 21,680 points
47 views
0 votes
1 answer

How can we achieve transclusion in AngularJs?

Hii,  In order to know what transclusion is ...READ MORE

answered Feb 5 in Angular by Niroj
• 21,680 points
37 views