@ioclaudio wrote:
Hi,
I’d like to create a service provider "QrcodemanagerService " and use it in all the pages of the application as a singleton.
My doubt is this:If I define the service provider in this way:
@Injectable({ providedIn: 'root' }) export class QrcodemanagerService {...}
Is still necessary to add it to the constructor of each page?
constructor(private navController: NavController, private statusManager: StatusmanagerService) {...}
Or, since I’ve added providedIn: ‘root’ in the definition, I can use it without including it in the constructor of the page?
If yes, how can I refer in a page to this sigleton?thank you
Claudio
Posts: 2
Participants: 2