Created
May 19, 2020 02:41
-
-
Save clintonyeb/ab9aed89c0e1d83d3086c366193f6070 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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