Project

General

Profile

Actions

Feature #46030

closed

mgr/dashboard: We should provide all services in root

Added by Tiago Melo almost 4 years ago. Updated about 3 years ago.

Status:
Resolved
Priority:
Normal
Assignee:
Category:
UI
Target version:
% Done:

0%

Source:
Tags:
Backport:
Reviewed:
Affected Versions:
Pull request ID:

Description

With the current approach of providing in a module it is still possible to create 2 instances of a service that is supposed to be a singleton.
We should use the suggested providedIn configuration:

Beginning with Angular 6.0, the preferred way to create a singleton service is to set providedIn to root on the service's @Injectable() decorator. This tells Angular to provide the service in the application root.

https://angular.io/guide/singleton-services

Actions

Also available in: Atom PDF