Sign In Start Free Trial
Account

Add to playlist

Create a Playlist

Modal Close icon
You need to login to use this feature.
  • Learning Ionic
  • Toc
  • feedback
Learning Ionic

Learning Ionic

By : Ravulavaru
4.4 (14)
close
Learning Ionic

Learning Ionic

4.4 (14)
By: Ravulavaru

Overview of this book

This book is intended for those who want to learn how to build hybrid mobile applications using Ionic. It is also ideal for people who want to explore theming for Ionic apps. Prior knowledge of AngularJS is essential to complete this book successfully.
Table of Contents (12 chapters)
close
11
Index

Ionic loading


The first service we are going to take a look at is $ionicLoading. This service is highly useful when you want to block a user's interaction from the main page and indicate to the user that there is some activity going on in the background.

To test this, we will scaffold a new blank template and implement $ionicLoading; run this:

ionic start -a "Example 21" -i app.example.twentyone example21 blank

Using the cd command, go to the example21 folder and run this:

  ionic serve

This will launch the blank template in the browser.

We will create an app controller and define the show and hide methods inside it. Open www/js/app.js and add the following code:

.controller('AppCtrl', function($scope, $ionicLoading, $timeout) {

    $scope.showLoadingOverlay = function() {
        $ionicLoading.show({
            template: 'Loading...'
        });
    };
    $scope.hideLoadingOverlay = function() {
        $ionicLoading.hide();
    };

    $scope.toggleOverlay = function() {
        $scope...

Unlock full access

Continue reading for free

A Packt free trial gives you instant online access to our library of over 7000 practical eBooks and videos, constantly updated with the latest in tech
bookmark search playlist font-size

Change the font size

margin-width

Change margin width

day-mode

Change background colour

Close icon Search
Country selected

Close icon Your notes and bookmarks

Delete Bookmark

Modal Close icon
Are you sure you want to delete it?
Cancel
Yes, Delete