O'Reilly logo

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Beginning AngularJS

Book Description

Beginning AngularJS is your step-by-step guide to learning the powerful AngularJS JavaScript framework. AngularJS is one of the most respected and innovative frameworks for building properly structured, easy-to-develop web applications. This book will teach you the absolute essentials, from downloading and installing AngularJS, to using modules, controllers, expressions, filters, and directives. Unlike many other books, you don't need experience with AngularJS or deep JavaScript knowledge to get started here.

This book will begin by teaching you the JavaScript you need to know, and then you'll get into the basics of AngularJS. You'll learn powerful AngularJS techniques through clear instructions. With what you learn you'll be able to properly structure your code into manageable modules, understand the MVC design patterns, create expressive and adaptive HTML forms, communicate with servers and use other AngularJS services, use the powerful built-in directives, and learn how to create your own. This might all seem unknown now, but with this book you'll understand it all.

AngularJS is a powerful framework, and one which may require you to think a little differently. This book will help you avoid the common pitfalls and get you up to speed, and building solid AngularJS applications, quickly and painlessly.

Table of Contents

  1. Cover
  2. Title
  3. Copyright
  4. Dedication
  5. Contents at a Glance
  6. Contents
  7. About the Author
  8. About the Technical Reviewer
  9. Acknowledgments
  10. Chapter 1: JavaScript You Need to Know
    1. JavaScript Primer
      1. Including Scripts on a Page
      2. Statements
      3. Functions
      4. Parameters and Return Values
      5. Types and Variables
      6. Primitive Types
      7. JavaScript Operators
      8. Equality vs. Identity
      9. Pre- vs. Post-Increment
    2. Working with Objects
      1. Creating Objects
      2. Reading and Modifying an Object’s Properties
      3. Adding Methods to Objects
      4. Enumerating Properties
      5. Control Flow
      6. Working with Arrays
      7. Callbacks
      8. JSON
    3. Summary
  11. Chapter 2: The Basics of AngularJS
    1. Why We Need Frameworks
      1. What Is a Framework?
    2. Downloading and Installing AngularJS
    3. Browser Support
    4. Your First AngularJS Application
      1. Declarative vs. Procedural Programming
      2. Directives and Expressions
    5. Summary
  12. Chapter 3: Introduction to MVC
    1. Design Patterns
      1. Model View Controller
      2. Why MVC Matters
      3. MVC the AngularJS Way
    2. Summary
  13. Chapter 4: Filters and Modules
    1. Introduction to Filters
    2. Built-in Filters
      1. The Number Filter
      2. The Date Filter
      3. The limitTo Filter
    3. AngularJS Modules
      1. What Is a Module?
    4. Bootstrapping AngularJS
    5. Creating a Custom Filter
    6. Summary
  14. Chapter 5: Directives
    1. The Basics of Directives
    2. Using Directives
    3. Built-in Directives
      1. ngBind
      2. ngCloak
      3. ngInclude
      4. ngShow and ngHide
      5. ngRepeat
      6. Event-Handling Directives
      7. Using the API Documentation
    4. Creating a Custom Directive
      1. The restrict Option
      2. The template Option
      3. The link Option
    5. Summary
  15. Chapter 6: Working with Forms
    1. HTML Forms Overview
      1. The form Element
      2. The input Element
      3. The textarea Element
      4. The select Element
      5. The label Element
      6. Model Binding
    2. AngularJS Forms
    3. Validating Forms
    4. Summary
  16. Chapter 7: Services and Server Communication
    1. Using Services
      1. The $window Service
      2. The $location Service
      3. The $document Service
    2. Creating Services
      1. Promises
    3. Server Communication
      1. Handling Returned Data
    4. Summary
  17. Chapter 8: Organizing Views
    1. Installing the ngRoute Module
    2. Using URL Routes
      1. Defining Routes
      2. Route Parameters
      3. Eager vs. Conservative Routes
      4. Route Configuration Options
      5. HTML5 Mode
    3. Summary
  18. Chapter 9: AngularJS Animation
    1. Installing the ngAnimate Module
    2. CSS Animation Overview
      1. Transforms
      2. Transitions
    3. Applying Animations
    4. Summary
  19. Chapter 10: Deployment Considerations
    1. Configuration
    2. Testing
    3. Error Handling
    4. Hide Unprocessed Templates
    5. Minification and Bundling
    6. Managing the Build Process
      1. Deployment
    7. Summary
  20. Index