I’m new to Angular (v5) and working with routes into Express (/api/my_route.js), in order to see if a input item value entered exists within my MongoDB collection.
The thing I’m not sure about and checked for a solution is that, I’m attempting to call this route to check the value in mongo when the user presses the tab key. When tab is pressed, it calls a function which in turn, was hoping would call my route.
Can you please let me know if a route can be called from a tab key press or should I be doing this another way as I’m still trying to get to grips with Angular?
From what I can see in my Express log, none of my console.log messages are appearing.
Thanks.
You can always bind the tab keydown event, listen for it, and then use angular router to navigate to whichever route you want.
<input (keydown.tab)="..."> //use the tab keydown event
In your controller
this.router.navigateByUrl(<ur route url>);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With