What You Will Learn from This Book
Setting Up a JavaScript Development Environment Using Node.js
Using Node.js to Run JavaScript
Creating an Express Web Server Using Node.js
Understanding JavaScript Data Types
Applying Comparison and Conditional Operators
Passing Variables to Functions
Returning Values from Functions
Creating Custom Defined Objects
Using a Prototyping Object Pattern
Searching a String for a Substring
Splitting a String into an Array
Converting an Array into a String
Checking Whether an Array Contains an Item
Adding Items to and Removing Items from Arrays
2 Getting Started with AngularJS
Views with Templates and Directives
An Overview of the AngularJS Life Cycle
The Runtime Data Binding Phase
Separation of Responsibilities
Integrating AngularJS with Existing JavaScript and jQuery
Adding AngularJS to Your Environment
Bootstrapping AngularJS in an HTML Document
Creating a Basic AngularJS Application
Loading the AngularJS Library and Your Main Module
Defining the AngularJS Application Root Element
Adding a Controller to the Template
Using jQuery or jQuery Lite in AngularJS Applications
Accessing jQuery or jQuery Lite Directly
Accessing jQuery or jQuery Lite Directly
3 Understanding AngularJS Application Dynamics
Looking at Modules and Dependency Injection
Defining an AngularJS Module
Object
Creating Providers in AngularJS Modules
Specialized AngularJS Object Providers
Implementing Providers and Dependency Injection
Injecting a Built-in Provider into a Controller
Implementing a Custom Provider and Injecting It into a Controller
Applying Configuration and Run Blocks to Modules
Implementing Configuration and Run Blocks
4 Implementing the Scope as a Data Model
The Relationship Between the Root Scope and Applications
The Relationship Between Scopes and Controllers
The Relationship Between Scopes and Templates
The Relationship Between Scope and Back-End Server Data
5 Using AngularJS Templates to Create Views
Interacting with the Scope in Expressions
Using JavaScript in AngularJS Expressions
Using Filters to Implement Ordering and Filtering
6 Implementing Directives in AngularJS Views
Directives That Support AngularJS Functionality
Directives That Extend Form Elements
Directives That Bind the Model to Page Elements
Directives That Bind Page Events to Controllers
7 Creating Your Own Custom Directives to Extend HTML
Understanding Custom Directive Definitions
Defining the Directive View Template
Restricting Directive Behavior
Adding a Controller to a Directive
Configuring the Directive Scope
Manipulating the DOM with a Link Function
Manipulating the DOM with a Compile Function
Implementing Custom Directives
Manipulating the DOM in Custom Directives
Implementing Event Handlers in a Custom Directive
Implementing Nested Directives
8 Using Events to Interact with Data in the Model
Adding $watches
to Track Scope Change Events
Using $watch
to Track a Scope Variable
Using $watchGroup
to Track Multiple Scope Variables
Using $watchCollection
to Track Changes to Properties of an Object in the Scope
Implementing Watches in a Controller
Emitting and Broadcasting Custom Events
Emitting a Custom Event to the Parent Scope Hierarchy
Broadcasting a Custom Event to the Child Scope Hierarchy
Handling Custom Events with a Listener
Implementing Custom Events in Nested Controllers
9 Implementing AngularJS Services in Web Applications
Understanding AngularJS Services
Sending HTTP GET
and PUT
Requests with the $http
Service
Using the $cacheFactory
Service
Implementing Browser Alerts Using the $window
Service
Interacting with Browser Cookies Using the $cookieStore
Service
Implementing Timers with $interval
and $timeout
Services
Using the $q
Service to Provide Deferred Responses
10 Creating Your Own Custom AngularJS Services
Understanding Custom AngularJS Services
Using a Factory Provider to Build a factory
Service
Using an Object to Define a service
Service
Integrating Custom Services into Your AngularJS Applications
Implementing a Simple Application That Uses All Four Types of Services
Implementing Simple Time Service
Implementing a Database Access Service
11 Creating Rich Web Application Components the AngularJS Way
Implementing Draggable and Droppable Elements
Adding a Zoom View Field to Images
Implementing Expandable and Collapsible Elements
Adding Star Ratings to Elements
A Testing AngularJS Applications
Deciding on a Testing Platform
Understanding AngularJS Unit Tests
Testing Controllers with User Input Bound to Scope Data
Testing Custom Directives That Use Transclusion
Testing Directives that Use External Templates