Dependency Injection with AngularJS
|Also available on:|
- Understand the concept of dependency injection
- Create reusable components in AngularJS
Book DetailsLanguage : English
Paperback : 78 pages [ 235mm x 191mm ]
Release Date : December 2013
ISBN : 1782166564
ISBN 13 : 9781782166566
Author(s) : Alex Knol
Topics and Technologies : All Books, Application Development, Open Source
Table of Contents
Chapter 1: Learning to Fly
Chapter 2: Better Code
Chapter 3: The Magic
Chapter 4: Testing
Chapter 5: Large Applications
Please let us know if you have found any errors not listed on this list by completing our errata submission form. Our editors will check them and add them to this list. Thank you.
Errata- 3 submitted: last submission 18 Mar 2014
Please igore the code download tip present on pages 3 and 15 of the book. This book doesn't have a separate code bundle. Please follow the steps and code given in the book.
Errata Type: Code Page 18
The second line of code on page 18 has an error. The correct one is as follows (the change has been highlighted - Missing quotes):
The code snippets in the book uses "Celcius". The correct spelling is "Celsius". But please make sure that if you want to use the correct spelling, make changes across all instances.
What you will learn from this book
- 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
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.
You will learn everything you need to know how to use dependency injection with AngularJS.
This book is a practical, hands-on approach to using dependency injection and implementing test-driven development using AngularJS.
Who this book is for