Created
September 12, 2019 13:32
-
-
Save FunnyGhost/72070f6dd1e9e945126bc529b9bb617f to your computer and use it in GitHub Desktop.
This file contains 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 { HttpClient } from '@angular/common/http'; | |
import { Injectable } from '@angular/core'; | |
import { Observable } from 'rxjs'; | |
import { retry } from 'rxjs/operators'; | |
import { environment } from 'src/environments/environment'; | |
import { Movie } from '../movie-list/core/models/movie'; | |
@Injectable() | |
export class FavoriteMoviesService { | |
constructor(private http: HttpClient) {} | |
getFavoriteMovies(): Observable<Movie[]> { | |
return this.http.get<Movie[]>(environment.favoriteUrl).pipe(retry(2)); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment