Best practices for provider injection in Angular [closed]
Clash Royale CLAN TAG#URR8PPP
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty margin-bottom:0;
up vote
0
down vote
favorite
This question can be subjective but I'm wonder about proper way to use common dependency injection for few providers.
For example, I have provider with dependencies:
@Injectable()
export class PushManager {
constructor(public oneSignal: OneSignal,
private config: ConfigHelper, private http: Http)
And I'm using this provider to get oneSignal injection:
this.pushManager.oneSignal.handleNotificationReceived()...
Is it common way to reuse injection or I just misunderstood conception?
dependency-injection angular-2+
closed as off-topic by Toby Speight, yuri, Sam Onela, Stephen Rauch, Josiah Aug 1 at 18:11
This question appears to be off-topic. The users who voted to close gave this specific reason:
- "Lacks concrete context: Code Review requires concrete code from a project, with sufficient context for reviewers to understand how that code is used. Pseudocode, stub code, hypothetical code, obfuscated code, and generic best practices are outside the scope of this site." â Toby Speight, yuri, Sam Onela, Stephen Rauch, Josiah
add a comment |Â
up vote
0
down vote
favorite
This question can be subjective but I'm wonder about proper way to use common dependency injection for few providers.
For example, I have provider with dependencies:
@Injectable()
export class PushManager {
constructor(public oneSignal: OneSignal,
private config: ConfigHelper, private http: Http)
And I'm using this provider to get oneSignal injection:
this.pushManager.oneSignal.handleNotificationReceived()...
Is it common way to reuse injection or I just misunderstood conception?
dependency-injection angular-2+
closed as off-topic by Toby Speight, yuri, Sam Onela, Stephen Rauch, Josiah Aug 1 at 18:11
This question appears to be off-topic. The users who voted to close gave this specific reason:
- "Lacks concrete context: Code Review requires concrete code from a project, with sufficient context for reviewers to understand how that code is used. Pseudocode, stub code, hypothetical code, obfuscated code, and generic best practices are outside the scope of this site." â Toby Speight, yuri, Sam Onela, Stephen Rauch, Josiah
1
This question is incomplete. To help reviewers give you better answers, please add sufficient context to your question. The more you tell us about what your code does and what the purpose of doing that is, the easier it will be for reviewers to help you. The current title states your concerns about the code; it needs an edit to simply state the task; see How to get the best value out of Code Review: Asking Questions for guidance on writing good question titles.
â Toby Speight
Aug 1 at 17:02
add a comment |Â
up vote
0
down vote
favorite
up vote
0
down vote
favorite
This question can be subjective but I'm wonder about proper way to use common dependency injection for few providers.
For example, I have provider with dependencies:
@Injectable()
export class PushManager {
constructor(public oneSignal: OneSignal,
private config: ConfigHelper, private http: Http)
And I'm using this provider to get oneSignal injection:
this.pushManager.oneSignal.handleNotificationReceived()...
Is it common way to reuse injection or I just misunderstood conception?
dependency-injection angular-2+
This question can be subjective but I'm wonder about proper way to use common dependency injection for few providers.
For example, I have provider with dependencies:
@Injectable()
export class PushManager {
constructor(public oneSignal: OneSignal,
private config: ConfigHelper, private http: Http)
And I'm using this provider to get oneSignal injection:
this.pushManager.oneSignal.handleNotificationReceived()...
Is it common way to reuse injection or I just misunderstood conception?
dependency-injection angular-2+
asked Aug 1 at 16:07
Autumn_Cat
101
101
closed as off-topic by Toby Speight, yuri, Sam Onela, Stephen Rauch, Josiah Aug 1 at 18:11
This question appears to be off-topic. The users who voted to close gave this specific reason:
- "Lacks concrete context: Code Review requires concrete code from a project, with sufficient context for reviewers to understand how that code is used. Pseudocode, stub code, hypothetical code, obfuscated code, and generic best practices are outside the scope of this site." â Toby Speight, yuri, Sam Onela, Stephen Rauch, Josiah
closed as off-topic by Toby Speight, yuri, Sam Onela, Stephen Rauch, Josiah Aug 1 at 18:11
This question appears to be off-topic. The users who voted to close gave this specific reason:
- "Lacks concrete context: Code Review requires concrete code from a project, with sufficient context for reviewers to understand how that code is used. Pseudocode, stub code, hypothetical code, obfuscated code, and generic best practices are outside the scope of this site." â Toby Speight, yuri, Sam Onela, Stephen Rauch, Josiah
1
This question is incomplete. To help reviewers give you better answers, please add sufficient context to your question. The more you tell us about what your code does and what the purpose of doing that is, the easier it will be for reviewers to help you. The current title states your concerns about the code; it needs an edit to simply state the task; see How to get the best value out of Code Review: Asking Questions for guidance on writing good question titles.
â Toby Speight
Aug 1 at 17:02
add a comment |Â
1
This question is incomplete. To help reviewers give you better answers, please add sufficient context to your question. The more you tell us about what your code does and what the purpose of doing that is, the easier it will be for reviewers to help you. The current title states your concerns about the code; it needs an edit to simply state the task; see How to get the best value out of Code Review: Asking Questions for guidance on writing good question titles.
â Toby Speight
Aug 1 at 17:02
1
1
This question is incomplete. To help reviewers give you better answers, please add sufficient context to your question. The more you tell us about what your code does and what the purpose of doing that is, the easier it will be for reviewers to help you. The current title states your concerns about the code; it needs an edit to simply state the task; see How to get the best value out of Code Review: Asking Questions for guidance on writing good question titles.
â Toby Speight
Aug 1 at 17:02
This question is incomplete. To help reviewers give you better answers, please add sufficient context to your question. The more you tell us about what your code does and what the purpose of doing that is, the easier it will be for reviewers to help you. The current title states your concerns about the code; it needs an edit to simply state the task; see How to get the best value out of Code Review: Asking Questions for guidance on writing good question titles.
â Toby Speight
Aug 1 at 17:02
add a comment |Â
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
1
This question is incomplete. To help reviewers give you better answers, please add sufficient context to your question. The more you tell us about what your code does and what the purpose of doing that is, the easier it will be for reviewers to help you. The current title states your concerns about the code; it needs an edit to simply state the task; see How to get the best value out of Code Review: Asking Questions for guidance on writing good question titles.
â Toby Speight
Aug 1 at 17:02