Questions tagged [angular-dependency-injection]

Use this tag if your question is specially about the behavior of the angular dependency injection framework.

Dependency injection (DI), is an important application design pattern. Angular has its own DI framework, which is typically used in the design of Angular applications to increase their efficiency and modularity.

Dependencies are services or objects that a class needs to perform its function. DI is a coding pattern in which a class asks for dependencies from external sources rather than creating them itself.

In Angular, the DI framework provides declared dependencies to a class when that class is instantiated. This guide explains how DI works in Angular, and how you use it to make your apps flexible, efficient, and robust, as well as testable and maintainable.

For more information about angular DI visit the official documentation

107 questions
0
votes
2 answers

Not able to inject Dependency Injection in angular4

i have a following class like this import { Injectable, Inject } from '@angular/core'; @Injectable() export class moviindustry { constructor(private music:musicindustry) { } producer() { this.music.album(); …
Lijin Durairaj
  • 4,910
  • 15
  • 52
  • 85
-1
votes
2 answers

How to trigger a method in a component when a method in a service is executed?

I have a chart configuration (with amCharts) in which an eventListener is registered for the bullets. This event listener triggers another function in my chart service. I want to trigger a method in my component as soon as the eventListener in the…
1 2 3 4 5 6 7
8