Why not data transferred from the components of Angular?

Friends, please help in correcting and adjusting MY code, the links don't work for me, I have tired and confused to do examples with references, as in the example all the way, but to adjust themselves under exactly comes out. I will be extremely grateful for the help!
Task - enter through input in one component, the line should go through the service in another component and caused by a request to an API parameter with this new line. I have something goes wrong - it seems the line does not reach.
The component input where I enter:
import { Component, the OnInit, Input, EventEmitter} from '@angular/core';
import { HttpService } from '../http.service'

@Component({
 selector: 'search',
 templateUrl: './search.component.html',
 styleUrls: ['./search.component.scss']
})

export class SearchComponent{
 InputFilm: string;

 constructor(private httpService: HttpService){
 this.httpService.InputFilm.subscribe(film => this.InputFilm = film)
}

handlerEnterSearch(){
this.httpService.setInputFilm(this.InputFilm);
 this.httpService.getFilms().subscribe(data =>{
this.httpService.setFilmsData(data)
 console.log('data: ', data);
});
}
ngOnInit(){}
}

Component where to get:
import { Component, the OnInit } from '@angular/core';
import { HttpService } from '../http.service'

@Component({
 selector: 'result',
 templateUrl: './result.component.html',
 styleUrls: ['./result.component.scss']
})
export class ResultComponent implements OnInit {

films:any;

 constructor(private httpService: HttpService){
 this.films = this.httpService.films
}
 ngOnInit() {}
}

And services:
import {Injectable} from '@angular/core';
import {EventEmitter} from '@angular/core';
import {HttpClient HttpParams} from '@angular/common/http';
import {Observable} from 'rxjs';
import { map } from 'rxjs/operators';

@Injectable()
export class HttpService{
 baseURL: string = "https://api.themoviedb.org/3";
 searchURL: string = "/search/movie"

 currentInputFilm: string;
 films: any

 InputFilm:EventEmitter<any> = new EventEmitter();

 constructor(private to http: HttpClient){ }

setInputFilm(inputFilm:string){
 this.currentInputFilm = inputFilm
 console.log('this.inputFilm: ', this.currentInputFilm);

}
setFilmsData(data){
 this.films = data
}

getFilms(){

 const params = new HttpParams().set('api_key', 'd6a5ac2d3d7cab11a084ca8080421b20').set('query', this.currentInputFilm)
 const options = {params: params};
 return this.http.get(this.baseURL+this.searchURL, options)
}
}

Please, this is not difficult to spend a couple of minutes to help, write what and where to fix it.
March 19th 20 at 09:22
0 answer

Find more questions by tags Angular