Skip to content

Instantly share code, notes, and snippets.

@vaibhavgehani
Created July 19, 2020 04:45
Show Gist options
  • Save vaibhavgehani/b109d368fbccbeec4dadc3b5bc897fb8 to your computer and use it in GitHub Desktop.
Save vaibhavgehani/b109d368fbccbeec4dadc3b5bc897fb8 to your computer and use it in GitHub Desktop.
export class HomePage {
MovieName = '';
url = environment.modelUrl;
public recommentList: any = [];
constructor(private http: HttpClient) {}
getRecommend() {
if (this.MovieName !== '') {
this.http.get(`${this.url}?name=${this.MovieName}`).subscribe((response) => {
console.log(response);
this.recommentList = response;
this.recommentList.forEach(element => {
element.poster_path = 'http://image.tmdb.org/t/p/w92' + element.poster_path;
});
});
}
}
clearField() {
this.MovieName = '';
this.recommentList = [];
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment