Commit 86552bca5e77312cde5665f65d6008ce03928bd6
1 parent
8b6bab1ec7
Exists in
master
and in
1 other branch
Creado servicio de tarjetas.
Showing
2 changed files
with
29 additions
and
0 deletions
Show diff stats
src/app/services/tarjetas.service.spec.ts
... | ... | @@ -0,0 +1,12 @@ |
1 | +import { TestBed } from '@angular/core/testing'; | |
2 | + | |
3 | +import { TarjetasService } from './tarjetas.service'; | |
4 | + | |
5 | +describe('TarjetasService', () => { | |
6 | + beforeEach(() => TestBed.configureTestingModule({})); | |
7 | + | |
8 | + it('should be created', () => { | |
9 | + const service: TarjetasService = TestBed.get(TarjetasService); | |
10 | + expect(service).toBeTruthy(); | |
11 | + }); | |
12 | +}); |
src/app/services/tarjetas.service.ts
... | ... | @@ -0,0 +1,17 @@ |
1 | +import { Injectable } from '@angular/core'; | |
2 | +import { HttpClient } from '@angular/common/http'; | |
3 | +import { Observable } from 'rxjs'; | |
4 | +import { appSettings } from 'src/etc/AppSettings'; | |
5 | + | |
6 | +@Injectable({ | |
7 | + providedIn: 'root' | |
8 | +}) | |
9 | +export class TarjetasService { | |
10 | + | |
11 | + constructor(private http: HttpClient) { } | |
12 | + | |
13 | + getTarjetas(): Observable<any> { | |
14 | + | |
15 | + return this.http.get(`${appSettings.apiUrl}/tarjetas`); | |
16 | + } | |
17 | +} |