Created
April 21, 2021 04:03
-
-
Save ScriptBytes/2dc2b7b18150f4b1d712b5a3e3aad7f7 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 { Injectable } from '@angular/core'; | |
import { HttpClient } from '@angular/common/http'; | |
import { Person } from './person.model'; | |
import { environment } from 'environments/environment'; | |
import { StoreService } from 'app/core/services/store.service'; | |
@Injectable({ | |
providedIn: 'root' | |
}) | |
export class PersonService extends StoreService<Person> { | |
constructor( | |
protected http: HttpClient | |
) { | |
super( | |
http, | |
{ | |
// url: environment.apiUrl + 'users/', Normally you use an environment variable to point to the api url | |
url: 'https://jsonplaceholder.typicode.com/users/', | |
idField: 'id', | |
itemName: 'Person' | |
} | |
); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment