Skip to content

Instantly share code, notes, and snippets.

@henryruhs
Last active April 20, 2022 11:25
Show Gist options
  • Save henryruhs/ce26f3f131d58fff8f5ded95ecc026a4 to your computer and use it in GitHub Desktop.
Save henryruhs/ce26f3f131d58fff8f5ded95ecc026a4 to your computer and use it in GitHub Desktop.
import { Component, OnChanges, OnInit } from '@angular/core';
import { ExampleService } from './example.service';
@Component(
{
selector: 'app-example',
styleUrls:
[
'./example.component.css'
],
templateUrl: './example.component.html'
})
export class ExampleComponent implements OnInit, OnChanges
{
constructor(protected exampleService : ExampleService)
{
}
ngOnInit() : void
{
this.exampleService
.enableAbort('GET', 2000)
.find()
.subscribe();
}
ngOnChanges() : void
{
this.exampleService.abort();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment