Skip to content

Instantly share code, notes, and snippets.

@d0rsha
Last active April 25, 2019 21:06
Show Gist options
  • Save d0rsha/44335d691307ec6716afeecba7d1e4b5 to your computer and use it in GitHub Desktop.
Save d0rsha/44335d691307ec6716afeecba7d1e4b5 to your computer and use it in GitHub Desktop.
[static service] How to use static variables by adding static services w/ variables #ionic

In mySerivce.ts make sure it is providedIn 'root'

@injectable({
  provideIn: 'root'
)}
export class myService { ... }  

In app.module.ts add the service to Providers

@NgModule({
  ...
  providers: [
    StatusBar,
    <ServiceName>
  	...
  ],
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment