Dependency Injection with AngularJS

If you want to start using AngularJS for real, this is the book you need. Its down-to-earth practical approach will quickly teach you all you need to know about dependency injection utilizing this versatile framework.
Preview in Mapt
Code Files

Dependency Injection with AngularJS

Alex Knol

If you want to start using AngularJS for real, this is the book you need. Its down-to-earth practical approach will quickly teach you all you need to know about dependency injection utilizing this versatile framework.
Mapt Subscription
FREE
$29.99/m after trial
eBook
$12.60
RRP $17.99
Save 29%
Print + eBook
$29.99
RRP $29.99
What do I get with a Mapt Pro subscription?
  • Unlimited access to all Packt’s 5,000+ eBooks and Videos
  • Early Access content, Progress Tracking, and Assessments
  • 1 Free eBook or Video to download and keep every month after trial
What do I get with an eBook?
  • Download this book in EPUB, PDF, MOBI formats
  • DRM FREE - read and interact with your content when you want, where you want, and how you want
  • Access this title in the Mapt reader
What do I get with Print & eBook?
  • Get a paperback copy of the book delivered to you
  • Download this book in EPUB, PDF, MOBI formats
  • DRM FREE - read and interact with your content when you want, where you want, and how you want
  • Access this title in the Mapt reader
What do I get with a Video?
  • Download this Video course in MP4 format
  • DRM FREE - read and interact with your content when you want, where you want, and how you want
  • Access this title in the Mapt reader
$0.00
$12.60
$29.99
$29.99 p/m after trial
RRP $17.99
RRP $29.99
Subscription
eBook
Print + eBook
Start 30 Day Trial

Frequently bought together


Dependency Injection with AngularJS Book Cover
Dependency Injection with AngularJS
$ 17.99
$ 12.60
Getting Started with Deep Learning with R [Integrated Course] Book Cover
Getting Started with Deep Learning with R [Integrated Course]
$ 124.99
$ 106.25
Buy 2 for $30.10
Save $112.88
Add to Cart

Book Details

ISBN 139781782166566
Paperback78 pages

Book Description

Dependency injection facilitates better testing by allowing us to mock dependencies in testing environments so that we only test one thing at a time. It also enables us to write more maintainable code by decoupling our objects from their implementations. The motivation for using it in AngularJS is to make it easier to transparently load mocked objects in tests.

This book is a practical manual to get you started on dependency injection. It will also take you along the road to creating testable and reusable code. Ensuring productivity and stability are the two most important things that you will learn.

"Dependency Injection with AngularJS" will introduce you to AngularJS using a simple sample project. By portraying different ways of developing code modules, it will show you the advantages of dependency injection. This will lead to the ability to create reusable components that can easily be tested.

The book contains a section that will show you how to make a chart component to display historical data. A short chapter will explain some of the theory and the reasons behind dependency injection. You will be introduced to Jasmine, a JavaScript behavior-driven development testing framework. You will learn how to test your code in real browsers using Karma, the lightning fast AngularJS test runner. Lastly the book will show you how to build reusable components you can stack on top of each other.

You will learn everything you need to know how to use dependency injection with AngularJS.

Table of Contents

Chapter 1: Learning to Fly
Let's get going
Adding a controller
What about routes?
Showing a list
Adding a filter
Chart directives
Summary
Chapter 2: Better Code
Wiring up the backend
Duplicating code
Angular service to the rescue
The theory behind Dependency Injection
Summary
Chapter 3: The Magic
Application flow
Different ways of injecting
Summary
Chapter 4: Testing
Test automation
Test your code, not the framework
Testing the parts
The Karma test runner
End-to-end testing
Summary
Chapter 5: Large Applications
Organizing your application
Organizing using dynamic teams
Nesting controllers
More powerful nesting
Application communication
Summary

What You Will Learn

  • Create reusable components propelled by the independence of components from each other
  • Run tests on real browsers using the Karma test runner
  • Set up Jasmine BDD testing
  • Set up and install AngularJS
  • Change coupled code to loosely coupled injected dependencies
  • Create integration tests using Protractor
  • Organize large applications using dependency injection

Authors

Table of Contents

Chapter 1: Learning to Fly
Let's get going
Adding a controller
What about routes?
Showing a list
Adding a filter
Chart directives
Summary
Chapter 2: Better Code
Wiring up the backend
Duplicating code
Angular service to the rescue
The theory behind Dependency Injection
Summary
Chapter 3: The Magic
Application flow
Different ways of injecting
Summary
Chapter 4: Testing
Test automation
Test your code, not the framework
Testing the parts
The Karma test runner
End-to-end testing
Summary
Chapter 5: Large Applications
Organizing your application
Organizing using dynamic teams
Nesting controllers
More powerful nesting
Application communication
Summary

Book Details

ISBN 139781782166566
Paperback78 pages
Read More

Read More Reviews

Recommended for You

AngularJS Essentials Book Cover
AngularJS Essentials
$ 20.99
$ 14.70
AngularJS Services Book Cover
AngularJS Services
$ 16.99
$ 11.90
Responsive Web Design with AngularJS Book Cover
Responsive Web Design with AngularJS
$ 17.99
$ 12.60
AngularJS Web Application Development Cookbook Book Cover
AngularJS Web Application Development Cookbook
$ 29.99
$ 6.00
Data-oriented Development with AngularJS Book Cover
Data-oriented Development with AngularJS
$ 19.99
$ 14.00
AngularJS Directives Book Cover
AngularJS Directives
$ 19.99
$ 2.00