app.component.ts
import { Component } from '@angular/core';
@Component({
selector: 'app-root',
templateUrl: './app.component.html',
styleUrls: ['./app.component.css']
})
export class AppComponent {
inputtedText:String = "";
getData(val:String){
this.inputtedText = val;
}
}
app.component.html
<h2>Angular Text Input On Change Listener</h2>
<input
type="text"
placeholder="Type your name here."
(input)="getData(box1.value)"
style="padding:12px; font-size:16px;"
#box1>
<h3>
Inputted Name :
{{inputtedText}}
</h3>
- angular - Interpolation expression
- angular - Interpolation string concatenation
- angular - Interpolation JavaScript property
- angular - Property binding example
- angular - How to use if else condition
- angular - How to use then else condition
- angular - How to use Button click event
- angular - How to call function on Button click
- angular - How to get text input value
- angular - How to create a counter
- angular bootstrap - Popover manual triggers
- angular bootstrap - Popover custom CSS class
- angular bootstrap - Popover shown & hidden event
- angular bootstrap - How to enable disable Datepicker
- angular bootstrap - Datepicker custom day style