Property ‘subscribe’ does not exist on type ‘() => Observable’

You are not calling the getVideos method. You are calling subscribe on the function reference of getVideos and not the returned value. Call subscribe after you call getVideos():

ngOnInit() {
    this.videoserv.getvideos().subscribe((response) => {
         this.videos = response
    });
}

Leave a Comment