Skip to content

Instantly share code, notes, and snippets.

@clintonyeb
Created May 19, 2020 02:41
Show Gist options
  • Save clintonyeb/ab9aed89c0e1d83d3086c366193f6070 to your computer and use it in GitHub Desktop.
Save clintonyeb/ab9aed89c0e1d83d3086c366193f6070 to your computer and use it in GitHub Desktop.
import { Search } from './../models/Search';
import { Component, OnInit, Output, EventEmitter, Input } from '@angular/core';
@Component({
selector: 'app-search',
templateUrl: './search.component.html',
styleUrls: ['./search.component.scss'],
})
export class SearchComponent implements OnInit {
@Output() search = new EventEmitter<Search>();
@Input() type: string;
constructor() {}
ngOnInit(): void {}
onInputChanged(event: any) {
const d = { type: this.type, value: event.target.value };
this.search.emit(d);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment