Created
October 7, 2017 11:59
-
-
Save tkssharma/f7c994ce5f721a4f605bc17f55a999f4 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() { | |
this.searchTextChange.emit({ | |
value: this.searchText | |
}) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment