Skip to content

Instantly share code, notes, and snippets.

@henryruhs
Last active April 20, 2022 11:24
Show Gist options
  • Save henryruhs/91126db106a0ccd362cb71a1d301bcb0 to your computer and use it in GitHub Desktop.
Save henryruhs/91126db106a0ccd362cb71a1d301bcb0 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
.enableCache('GET', 2000)
.find()
.subscribe();
}
ngOnChanges() : void
{
this.exampleService.flush();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment