Book Image

PhoneGap and AngularJS for Cross-platform Development

By : Yuxian E Liang
Book Image

PhoneGap and AngularJS for Cross-platform Development

By: Yuxian E Liang

Overview of this book

PhoneGap is a mobile development framework that allows developers to build cross-platform mobile applications. Building PhoneGap apps is traditionally done using HTML, CSS, jQuery Mobile, Eclipse Editor, and/or Xcode. The process can be cumbersome, from setting up your editor to optimizing your usage of jQuery, and so on. However, AngularJS, a new but highly popular JavaScript framework, eases these tasks with APIs to get access to mobile APIs such as notifications, geo-location, accelerometers, and more. Starting with the absolute basics of building an AngularJS application, this book will teach you how to quickly set up PhoneGap apps using the command-line interface. You will learn how to create simple to advanced to-do lists and add authentication capabilities using PhoneGap's plugins. You will enhance your skills by writing a PhoneGap app using your newly learned AngularJS skills. Furthermore, you will learn about adding animation and interactive designs to your mobile web apps using PhoneGap plugins. By the end of the book, you will know everything you need to launch your app on both Android and iOS devices.
Table of Contents (14 chapters)
PhoneGap and AngularJS for Cross-platform Development
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Adding mobile CSS styles to your app


In order to further spruce up our app, we will be leveraging on the CSS libraries of TopCoat. You can get TopCoat CSS libraries from http://topcoat.io/. We also need to change our index.html file a bit more in order to leverage on the styles provided by TopCoat.

  1. For a start, replace the stylesheet which points to Bootstrap CDN with the following code:

    <link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/topcoat/0.8.0/css/topcoat-mobile-light.css">
    
  2. After this, just before <div ng-view class="todos"></div>, prepend the following code:

    <div class="topcoat-navigation-bar">
          <div class="topcoat-navigation-bar__item center full">
              <h1 class="topcoat-navigation-bar__title">Todos</h1>
          </div>
      </div>
    

    This is to give a universal header that we commonly see in mobile apps.

    After these changes, your index.html file should look like this:

    <!doctype html>
    <html ng-app="todoApp...