O'Reilly logo

Seven Web Frameworks in Seven Weeks by Frederic Daoud, Jack Moffitt

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

Day 1: Using Dependency Injection

Today we begin learning about AngularJS by looking at dependency injection and services. After discussing those foundations, we’ll jump right into building a sample application. We’ll define resources that talk to the server and even write automated tests that exercise our code. We’ve got a big day ahead of us!

One of the most distinguishing features of AngularJS is its dependency injection container. Without it, direct function calls between components tie them together for life. Instead, you define services and indicate what other services are needed by each service, keeping a clean separation of concerns.

Dependency injection goes a long way in keeping your code modular and testable. Each service is a block ...

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

Start Free Trial

No credit card required