Start reading Dependency Injection with AngularJS on your Kindle in under a minute. Don't have a Kindle? Get your Kindle here or start reading now with a free Kindle Reading App.

Deliver to your Kindle or other device

 
 
 

Try it free

Sample the beginning of this book for free

Deliver to your Kindle or other device

Sorry, this item is not available in
Image not available for
Colour:
Image not available
 

Dependency Injection with AngularJS [Kindle Edition]

Alex Knol
2.7 out of 5 stars  See all reviews (3 customer reviews)

Print List Price: £18.99
Kindle Price: £14.39 includes VAT* & free wireless delivery via Amazon Whispernet
You Save: £4.60 (24%)
* Unlike print books, digital books are subject to VAT.

Free Kindle Reading App Anybody can read Kindle books—even without a Kindle device—with the FREE Kindle app for smartphones, tablets and computers.

To get the free app, enter your e-mail address or mobile phone number.

Formats

Amazon Price New from Used from
Kindle Edition £14.39  
Paperback £18.99  
Kindle Daily Deal
Kindle Daily Deal: Up to 70% off
Each day we unveil a new book deal at a specially discounted price--for that day only. Learn more about the Kindle Daily Deal or sign up for the Kindle Daily Deal Newsletter to receive free e-mail notifications about each day's deal.

Book Description

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.


Customers Who Bought This Item Also Bought

Page of Start over
This shopping feature will continue to load items. In order to navigate out of this carousel please use your heading shortcut key to navigate to the next or previous heading.

Product Description

About the Author

Alex Knol

Alex Knol is a lifelong tech geek with a passion for automation. After spending some years away from software development, around the beginning of this century, he took up PHP development based on his early experiences with C and Pascal. Surprisingly, he has never really used web tools, but applications instead, to make websites, such as the platform that's driving kaizegine.com. Having built various applications using web technologies and frameworks, such as Symfony, he discovered AngularJS at the beginning of 2008, while searching for a way to structure frontend application code and make development easy. He used AngularJS, among other technologies, for a job-matching project in the Netherlands and, more recently, for an online website designer named Risingtool.com.


Product details

  • Format: Kindle Edition
  • File Size: 884 KB
  • Print Length: 78 pages
  • Publisher: Packt Publishing (18 Dec. 2013)
  • Sold by: Amazon Media EU S.à r.l.
  • Language: English
  • ASIN: B00HEGSL0Y
  • Text-to-Speech: Enabled
  • X-Ray:
  • Word Wise: Not Enabled
  • : Not Enabled
  • Average Customer Review: 2.7 out of 5 stars  See all reviews (3 customer reviews)
  • Amazon Bestsellers Rank: #859,422 Paid in Kindle Store (See Top 100 Paid in Kindle Store)
  •  Would you like to give feedback on images?


What Other Items Do Customers Buy After Viewing This Item?


Customer Reviews

2.7 out of 5 stars
2.7 out of 5 stars
Most Helpful Customer Reviews
1 of 1 people found the following review helpful
Format:Paperback|Verified Purchase
I've bought several Packt Publishing books over the years, notably for Silverlight, and been astounded at how poor their titles have been. They need an editor who understands technology and what makes a good book. On Twitter their name frequently shows up as a company prepared to pay money to anyone to write a book, whether they have credibility or real knowledge or not. I learnt to avoid them, but then they released "Mastering Web Application Development with AngularJS" which turned out to be one of the best Angular books on the market.

So I decided to check out their other titles.

This is a huge disappointment. It's more a pamphlet than a book. 63 pages of editorial content, the first four of which are the usual "Who this book is for", "Customer Feedback" filler. The print size is big for such a small book. 20% in and the so-called subject matter of the book hasn't been covered. Instead we get a tedious "Hello world" Angular sample that is covered so clumsily, with references to so many irrelevant bits and pieces that a beginner can only get confused. This stuff isn't difficult. If Dan Wahlin can explain a lot of the complexity of Angular in an "Angular in 60-ish Minutes" book (or at his ng-conf talk "in 20-ish minutes") then a book like this should be able to explain a trivial "Hello World" example in far less space than it does here. The English is grammatically incorrect as if no native English speaker got to proof-read it (what are publishers like Packt Publishing doing for their money?) The language is flowery without imparting any real knowledge at all. Here's a sentence from page 6 of the book: "When you are used to working with tools such as jQuery or Prototype, a new dimension and a model, will be added to your world." Well thanks for that!
Read more ›
Comment | 
Was this review helpful to you?
4.0 out of 5 stars Good for beginners, not enough for experts 22 Jan. 2014
Format:Paperback
With this book about AngularJS Dependency Injection, Alex Knol attempts to focus on one but surely the most important part of AngularJS components.

You'll first find a brief introduction about AngularJS, how to setup, and samples to get started. The book will then guide you through good practices and to the why and the how dependency injection helps your application to scale with new features. It covers the SOLID principles, and the complex subject of unit and functional (or e2e) testing with many code samples. Also it suggests code architecture to avoid your application to become a giant mess of .js files.

About the book itself, while it remain a very good introduction to enterprise level application with AngularJS, it stills focus on the essential of the dependency injection component of AngularJS. Experts won't find here a complete description of all the facets of the library (factories, providers, container hooks and building process...). On the other hand, beginners and intermediate programmers will have a good vision of the power of dependency injection done right with AngularJS.
Comment | 
Was this review helpful to you?
Format:Kindle Edition
This is a short book (63 pages in my PDF copy) which, according to its subtitle, aims to teach you to “Design, control, and manage your dependencies with AngularJS dependency injection.”

It starts off by introducing Angular in a fairly standard way in chapter 1. The next chapter introduces some concepts around clean code, the SOLID principles and Dependency Injection itself, then chapter 3 shows how DI works in AngularJS. Chapter 4 covers testing, and finally chapter 5 discusses management of large applications and code-bases.

The book is well-written and edited, clear and concise, and I found it easy to read and follow. The examples are mostly simple and get the point across, but this is not an in-depth or exhaustive tutorial. In the Testing chapter, in particular, the author covers a wide range of Angular testing practices, including Jasmine, Karma, and Protractor, but I would have liked to see more detail in the unit-testing pages, which is where Angular’s dependency injection facilities really shine. The examples given show the use of the inject function from Angular Mocks, and the use of a Scope and a Service stub to test a controller, but no mention is made of other Angular features designed to make testing easy, such as the mock-able $window and $timeout services provided in the core framework. The mention of Karma as a test runner is pertinent, but I question the inclusion of Protractor in the chapter since this is a top-level, end-to-end, integration testing tool, and so has no relevance to Dependency Injection.

In the end, my only real criticism of this book is its title (yes, I am judging it by its cover).
Read more ›
Comment | 
Was this review helpful to you?
Most Helpful Customer Reviews on Amazon.com (beta)
Amazon.com: 2.1 out of 5 stars  7 reviews
5 of 5 people found the following review helpful
1.0 out of 5 stars Incoherent, rambling pamphlet that is seriously overpriced and fails to live up to its title 22 Jan. 2014
By I. D. Smith - Published on Amazon.com
Format:Paperback
I've bought several Packt Publishing books over the years, notably for Silverlight, and been astounded at how poor their titles have been. They need an editor who understands technology and what makes a good book. On Twitter their name frequently shows up as a company prepared to pay money to anyone to write a book, whether they have credibility or real knowledge or not. I learnt to avoid them, but then they released "Mastering Web Application Development with AngularJS" which turned out to be one of the best Angular books on the market.

So I decided to check out their other titles.

This is a huge disappointment. It's more a pamphlet than a book. 63 pages of editorial content, the first four of which are the usual "Who this book is for", "Customer Feedback" filler. The print size is big for such a small book. 20% in and the so-called subject matter of the book hasn't been covered. Instead we get a tedious "Hello world" Angular sample that is covered so clumsily, with references to so many irrelevant bits and pieces that a beginner can only get confused. This stuff isn't difficult. If Dan Wahlin can explain a lot of the complexity of Angular in an "Angular in 60-ish Minutes" book (or at his ng-conf talk "in 20-ish minutes") then a book like this should be able to explain a trivial "Hello World" example in far less space than it does here. The English is grammatically incorrect as if no native English speaker got to proof-read it (what are publishers like Packt Publishing doing for their money?) The language is flowery without imparting any real knowledge at all. Here's a sentence from page 6 of the book: "When you are used to working with tools such as jQuery or Prototype, a new dimension and a model, will be added to your world." Well thanks for that!

At the time of writing there is just one other review - for four stars. I can only assume it was written by a friend of the author. The book is seriously over-priced, incoherent and rambling and fails to meet its stated goals. I have no idea why it's called "Dependency Injection" since it's really just a random set of thoughts on bits of Angular or principles of SOLID (3 pages explaining what the acronym means in a section entitled "the theory behind Dependency Injection"). It's like a bad student took all the little bits of knowledge he'd picked up and just threw them on a page and said "Let's call it a book".

The sample code is poorly presented (eg script libraries have spaces after the . separators) and the code was written to Angular v1.04

Don't waste your money. There are far better resources out there. For just a little bit more cash you can buy a book with ten times the page count and ten times the teaching quality of this pamphlet ("ng-book")
2 of 2 people found the following review helpful
3.0 out of 5 stars Worth it's price? Not really! 3 Feb. 2014
By Arun Mahendrakar - Published on Amazon.com
Format:Paperback
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.
2 of 2 people found the following review helpful
1.0 out of 5 stars Awful 21 Mar. 2014
By moppy - Published on Amazon.com
Format:Paperback
Unfortunately this book is quite useless.

So many many errors (did anyone check the code?) and most content is just a bad copy of the AngularJs official website.
4.0 out of 5 stars Good for beginners, not enough for experts 22 Jan. 2014
By Michel Salib - Published on Amazon.com
Format:Paperback
With this book about AngularJS Dependency Injection, Alex Knol attempts to focus on one but surely the most important part of AngularJS components.

You’ll first find a brief introduction about AngularJS, how to setup, and samples to get started. The book will then guide you through good practices and to the why and the how dependency injection helps your application to scale with new features. It covers the SOLID principles, and the complex subject of unit and functional (or e2e) testing with many code samples. Also it suggests code architecture to avoid your application to become a giant mess of .js files.

About the book itself, while it remain a very good introduction to enterprise level application with AngularJS, it stills focus on the essential of the dependency injection component of AngularJS. Experts won’t find here a complete description of all the facets of the library (factories, providers, container hooks and building process…). On the other hand, beginners and intermediate programmers will have a good vision of the power of dependency injection done right with AngularJS.
1.0 out of 5 stars Not worth it... 6 Jun. 2014
By P. Haydon - Published on Amazon.com
Format:Paperback
I mainly bought this for the Unit Testing aspect of Angular, but being such a short read I read the entire thing...

The book is full of errors, it read like a rough cut that no one has bothered reviewing, and often parts that should be explained are just shrugged off by pointing the reader to the documentation.

I wouldn't recommend this book to someone wanting to learn Angular or a seasoned programmer. It's just not a good book.
Were these reviews helpful?   Let us know
Search Customer Reviews
Only search this product's reviews

Customer Discussions

This product's forum
Discussion Replies Latest Post
No discussions yet

Ask questions, Share opinions, Gain insight
Start a new discussion
Topic:
First post:
Prompts for sign-in
 

Search Customer Discussions
Search all Amazon discussions
   


Look for similar items by category