售 价:¥
温馨提示:数字商品不支持退换货,不提供源文件,不支持导出打印
为你推荐
Learning Node.js for Mobile Application Development
Table of Contents
Learning Node.js for Mobile Application Development
Credits
About the Authors
About the Reviewers
www.PacktPub.com
Support files, eBooks, discount offers, and more
Why subscribe?
Free access for Packt account holders
Preface
What this book covers
What you need for this book
Who this book is for
Conventions
Reader feedback
Customer support
Downloading the example code
Downloading the color images of this book
Errata
Piracy
Questions
1. Setting Up Your Workspace
The Node.js backend
Installing Node.js on different systems
Windows
Linux
Ubuntu/Debian
Fedora/RHEL/CentOS
Verifying your installation
Mac OS X
Verifying your installation
Setting up the Ionic framework and Cordova for Mac OS X
Setting up the Ionic framework and Cordova for Windows
Setting up the platform dependencies
Installing Java
Setting up Android Studio for Android, Mac, and Windows
Setting up the Android Software Development Kit
Setting up your physical Android device for development
Enabling Developer options
Enabling USB debugging
Trusting a computer with installed IDE using secure USB debugging (devices with Android 4.4.2)
Setting up the Environment Variables on Windows 7 and higher
Setting up the Environment Variables for iOS on Mac OS X
Installing the iOS SDK
MongoDB
Installation of MongoDB on different Operating System
Windows
Linux
Ubuntu
Fedora/RHEL/CentOS
Starting MongoDB
Mac OS X
Connecting to MongoDB
Windows
Linux and OS X
Summary
2. Configuring Persistence with MongoDB
Learning outcomes of MongoDB
An introduction to MongoDB
Documents
Collections
Databases
An example – a product order database
Connecting to MongoDB
Linux and Mac OS X
Windows
Creating a database
Creating our collections
Creating relations between documents
Querying MongoDB
Searching by ID
Searching by property value
Advanced queries
Connecting MongoDB and Node.js
Setting up a basic project
Connecting to MongoDB
Summary
3. Creating an API
Learning outcomes of the RESTful API
RESTing easy
It's all hypermedia
GET
GET all
GET by ID
POST
PUT
DELETE
Building a RESTful API with Node.js
Setting up the RESTful API
The HTTP module
Dissecting the HTTP server
Returning JSON
Implementing our GET handlers
Implementing a router
Implementing our POST handlers
Implementing the DELETE and PUT handlers
Testing the API
Moving forward
Summary
4. Securing Your Backend
Understanding the outcomes of token-based authentication
The theoretical bit
A small token of trust
Playing your role
Putting it all together
Implementation
Adding the new collections
Adding an authentication module
Creating functions to register and help users log in
Registering users
Enabling users to log in
Extending our API
OAuth
Time-stamped access tokens
Hashing passwords
Summary
5. Real-Time Data and WebSockets
Polling
WebSockets
Using WebSockets in Node.js
Setting up our project
Installing socket.io
Creating a chat interface
A basic file server
An alternate chat
The efficient serving of static files
Summary
6. Introducing Ionic
Setting up your Ionic web account
Creating your first Ionic application
Checking out your Ionic applications with Ionic View
Installing Ionic View on Android
Installing Ionic View on iOS
Testing your application on the iOS Ionic View App
Testing your application on Android
Sharing your application with collaborators
Going further
Summary
7. Building User Interfaces
The structure of an Ionic project
Introducing AngularJS
The structure of an Angular app
Modules
Modules within modules within modules
Services, controllers, and other beasts
The Angular MVC pattern
The view
The controller
The model
Putting it all together
Modifying an Ionic project
Modifying the header
Modifying the tab colour, icons, and names
Modifying our pages
Adding a new tab
Creating a new controller
Creating a view
Adding a state for the new tab
Testing the newly created tab
Going further
Summary
8. Making Our App Interactive
Creating a new project
Creating a basic MVC project
Creating the view
Creating the list view
Creating the controller
Connecting the view and controller
Testing the connection
Creating the model
Services
Creating services
Creating a factory
Accessing the device data
Accessing native services
ngCordova
Adding Cordova contacts to our factory
Building for native devices
Android
Emulator
A physical device
The list view revisited
Summary
9. Accessing Native Phone Features
Creating the project
Creating the basic app structure
Integrating Google Maps into the app
Angular directives
Creating directives
Restricting directives
Scope isolation
DOM manipulation
Putting it all together
Adding geolocation via GPS
Summary
10. Working with APIs
Setting up Parse
Setting up the Ionic project
Connecting Parse to our project
Defining app states
Creating controllers and templates
Testing our application
Summary
11. Working with Security
An overview of client-side security
Client-side security is a convenience
The basic components of client-side security
Building a secure app
Starting off
A basic authentication service
The login function
The isAuthenticated function
The getCurrent function
Implementing route authentication
Summary
12. Working with Real-Time Data
A refresher – WebSockets
Getting the lay of the land
What we will need
Creating the server
Building the chat app
Setting up the basic app structure
The input section
The message view
The ChatService function
Adding WebSockets to the mix
Updating the chat view
Going further
Summary
13. Building an Advanced Chat App
We need some room!
Namespaces
Creating a multiroom chat application
Configuring the basic layout
Building the server
Summary
14. Creating an E-Commerce Application Using the Ionic Framework
Designing our application
Creating an Ionic project
Implementing our designs
Setting up the product API
Connecting the product API to our Ionic app
Summary
Index
买过这本书的人还买过
读了这本书的人还在读
同类图书排行榜