import { NgModule } from '@angular/core';
import { OBSERVE_EFFECT } from 'ngx-crud';
import { ExampleEffect } from './example.effect';
@NgModule(
{
providers:
[
{
provide: OBSERVE_EFFECT,
useClass: ExampleEffect
}
]
})
export class AppModule
{
}
import { Injectable } from '@angular/core';
import { HttpErrorResponse, HttpRequest, HttpResponse } from '@angular/common/http';
import { ObserveBeforeEffect, ObserveAfterEffect } from 'ngx-crud';
@Injectable()
export class ExampleEffect implements ObserveBeforeEffect, ObserveAfterEffect
{
before<T>(request : HttpRequest<T>) : HttpRequest<T>
{
}
after<T>(request : HttpRequest<T>, response : HttpResponse<T> | HttpErrorResponse) : void
{
}
}
exampleService->enableObserve();