欧宝娱乐

Jump to ratings and reviews
Rate this book

Dependency Injection with AngularJS

Rate this book
In Detail

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.

Approach

This book is a practical, hands-on approach to using dependency injection and implementing test-driven development using AngularJS.

Who this book is for

Dependency Injection with AngularJS is aimed at developers who are aware of AngularJS but need to get started with using it in real life applications. Also, developers who want to get into test-driven development with AngularJS can use this book as practical guide. Even if you know about dependency injection, it can serve as a good reference on how it is used within AngularJS. Readers are expected to have some experience with JavaScript.

78 pages, Kindle Edition

First published January 1, 2013

1 person is currently reading
16 people want to read

About the author

Alex Knol

1book

Ratings & Reviews

What do you think?
Rate this book

Friends & Following

Create a free account to discover what your friends think of this book!

Community Reviews

5 stars
1 (4%)
4 stars
0 (0%)
3 stars
6 (28%)
2 stars
10 (47%)
1 star
4 (19%)
Displaying 1 - 5 of 5 reviews
Profile Image for Antonio.
96 reviews
January 27, 2014

Design, control, and manage your dependencies with AngularJS dependency injection

Overview

Understand the concept of dependency injection Isolate units of code during testing JavaScript using Jasmine Create reusable components in AngularJS

In Detail

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.

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

Approach

This book is a practical, hands-on approach to using dependency injection and implementing test-driven development using AngularJS.

Who this book is written for

Dependency Injection with AngularJS is aimed at developers who are aware of AngularJS but need to get started with using it in real life applications. Also, developers who want to get into test-driven development with AngularJS can use this book as practical guide. Even if you know about dependency injection, it can serve as a good reference on how it is used within AngularJS. Readers are expected to have some experience with JavaScript.

**

223 reviews6 followers
November 2, 2014
This is a pretty small book, about 80 pages or so. The core of the book is about how Dependency Injection happens in AngularJS.

The third chapter 'The Magic' talks all about how this happens. Author also talks the issues faced when you minify your .js files and how ngmin helps you in this regard. So it is the most interesting chapter in the book.

The last chapter gives some layout ideas for large applications that you might want to consider.

The whole concept of DI in AngularJS is more of a blog article, not sure if a book is required for that. In fact, in the third chapter, the author does provide a blog ([...]) where the exact same information is available (for free).

The chapter on Testing could have been even more detailed. The author could have shown some of gotchas and tips on how to debug end-to-end tests written in Protractor.
80 reviews4 followers
October 7, 2014
The title is quite misleading. The book is a short summary of Angular JS as a whole. No insight on dependency injection given - there is more information about testing, than the main topic.

Don't waste your time with this book.
590 reviews11 followers
March 11, 2014
The book is way too small to deliver any value and costs a fortune when you divide the price by its pages.
Profile Image for Dario Iacampo.
2 reviews2 followers
August 24, 2014
not for beginners, not for experienced angularjs users, contents are well presented and there are good ideas
Displaying 1 - 5 of 5 reviews

Can't find what you're looking for?

Get help and learn more about the design.