i have not able to see my title name to movieDetails page after that i have also not able to see my image ion-card (err shows it : 404 not found )please help me this i struck in this;
here is my code:
movieDetails.page.html:
<ion-title>{{movie?.title}}</ion-title>
<ion-buttons slot="start">
<ion-back-button defaultHref="/movies"></ion-back-button>
</ion-buttons>
<ion-card *ngIf=“movie”>
<img [src]="imageBaseUrl + '/w400' + movie.poster_path"/>
movieDetails.page.ts:
import { Component, OnInit } from ‘@angular/core’;
import { ActivatedRoute } from ‘@angular/router’;
import { MovieService } from ‘src/app/services/movie.service’;
import { environment } from ‘src/environments/environment’;
@Component({
selector: ‘app-movie-details’,
templateUrl: ‘./movie-details.page.html’,
styleUrls: [’./movie-details.page.scss’],
})
export class MovieDetailsPage implements OnInit {
movie = null;
imageBaseUrl = environment.images;
constructor(
private route: ActivatedRoute,
private movieService: MovieService
) {}
ngOnInit() {
const id = this.route.snapshot.paramMap.get('id');
this.movieService.getMovieDetails(id).subscribe(function (res) {
console.log(res);
this.movie = res;
});
}
}