Sign In Start Free Trial
Account

Add to playlist

Create a Playlist

Modal Close icon
You need to login to use this feature.
  • AngularJS Web Application Development Blueprints
  • Toc
  • feedback
AngularJS Web Application Development Blueprints

AngularJS Web Application Development Blueprints

By : Vinci J Rufus
4.3 (7)
close
AngularJS Web Application Development Blueprints

AngularJS Web Application Development Blueprints

4.3 (7)
By: Vinci J Rufus

Overview of this book

If you are a web application developer interested in using AngularJS for a real-life project, then this book is for you. As a prerequisite, knowledge of JavaScript and HTML is expected, and a working knowledge of AngularJS is preferred.
Table of Contents (12 chapters)
close
11
Index

Adding touch events


Given that we are building this app mainly for mobile and tablet devices, it's crucial to allow touch and swipe events.

Enabling swipe gestures using ngTouch

Thankfully, AngularJS comes with a nice module called ngTouch, which allows us to easily add touch and swipe gestures. The ngTouch file doesn't come as a default with AngularJS and needs to be included separately.

Download the ngTouch file using bower by typing the following command in the terminal:

bower install angular-touch --save

We'll include ngTouch by adding the following script file in our app/index.html file, as highlighted in the following code:

<script src="bower_components/angular-touch/angular-touch.js"></script>

Make sure that ngTouch is called after AngularJS.

The next step is to add it as a dependency for our app.

We will add it in our angular.module function in our app/js/app.js file, as highlighted in the following code:

angular.module('myApp', [
  'ngRoute',
  'myApp.filters',
  'myApp.services...

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