Skip to main content

Custom tokens

Providing the LoadingService in a component or in a module will allow the use of custom injection tokens that can access to the service instance in the NodeInjector.

Injection Tokens

SOME_LOADING

When injected, it allows you to observe the changes to the state between all service loading property, like the someLoading helper function.

import { NgModule } from '@angular/core';
import { AppComponent } from './app.component.ts';
import { HelloComponent } from './hello.component.ts';
import { ReactiveLoadingModule } from 'ngx-reactive-loading';

@NgModule({
declarations: [AppComponent, HelloComponent],
imports: [ReactiveLoadingModule.forRoot(['prop1'])],
})
export class AppModule {}