Created
October 5, 2017 04:05
-
-
Save tkssharma/be2846d76540fcc3e61fc5a9141de0df 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 { Component, Input, OnInit, Output, EventEmitter } from '@angular/core'; | |
| @Component({ | |
| selector: 'search-bar', | |
| template: '<div class="search-bar" > <input [(ngModel)]="searchText" (change)="handleChange()" /></div>' | |
| }) | |
| export default class SearchBar implements OnInit { | |
| @Output() searchTextChange = new EventEmitter(); | |
| searchText: string; | |
| constructor() { } | |
| ngOnInit() { } | |
| handleChange() { | |
| console.log(this.searchText); | |
| this.searchTextChange.emit({ | |
| value: this.searchText | |
| }) | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment