I just used the event input and it worked fine as follows:
in .html file :
<input type="text" class="form-control" (input)="onSearchChange($event.target.value)">
in .ts file :
onSearchChange(searchValue: string): void {
console.log(searchValue);
}
More Related Contents:
- Can I get today’s date plus one month in moment js? [duplicate]
- angular-cli server – how to proxy API requests to another server?
- Changing the page title using the Angular 2 new router [duplicate]
- Passing data into “router-outlet” child components
- How to instantiate and apply directives programmatically?
- How can get HttpClient Status Code in Angular 4
- Angular 4 – Update Meta tags dynamically for Facebook (Open graph)
- How to access a constant in an Angular 2 component and service?
- Angular2 child component as data
- Is there a type for “Class” in Typescript? And does “any” include it?
- angular 2 – adding 3rd party libs
- Cannot find a differ supporting object ‘[object Object]’ of type ‘object’. NgFor only supports binding to Iterables such as Arrays
- @firebase/firestore: Firestore (5.0.4): Could not reach Cloud Firestore backend. Backend didn’t respond within 10 seconds
- Is Angular 2’s Router broken when using HTML5 routes? [duplicate]
- Angular2 router.navigate refresh page
- Angular 6 – Could not find module “@angular-devkit/build-angular”
- What are all the valid selectors for ViewChild and ContentChild?
- No methods in http response object
- Redirect to a different component inside @CanActivate in Angular2
- What is the difference between ActivatedRoute and ActivatedRouteSnapshot in Angular4
- ERROR in TypeError: Cannot read property ‘flags’ of undefined
- How to get Angular2 to bind component in innerHTML
- Want to prevent Component recreation while routing in Angular 2
- How to clear form after submit in Angular 2?
- Page transition animations with Angular 2.0 router and component interface promises
- Inject Http manually in Angular 2
- Error from chokidar (C:\): Error: EBUSY: resource busy or locked, lstat ‘C:\DumpStack.log.tmp
- Angular 6 Uncaught ReferenceError: Buffer is not defined
- Angular 6 Migration -.angular-cli.json to angular.json
- Filtering specific column in Angular Material Table with filtering in angular?