Reputation: 1629
I need to take what the user writes in input, so I do this ( in my html page):
<label>Filter Name</label>
<input type="text" (keyup.enter)="onKeyEnter()" name="book_name"/>
and in my .ts i do:
onKeyEnter(){
console.log("Home");
}
The problem is the console it doesn't print console. Anyone cna help me?
Upvotes: 0
Views: 59
Reputation: 222522
If you need to handle keyup you can use (keyup)
instead. keyup.enter
works only for Enter key
<input type="text" (keyup)="onKeyEnter()" name="book_name"/>
Upvotes: 1