Last active
April 20, 2022 11:25
-
-
Save henryruhs/ce26f3f131d58fff8f5ded95ecc026a4 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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