Within the HTML code, data is received and stored in variables within my TypeScript file. At the end of the HTML, there is a button that was created separately from any user input containers. This button triggers a function that processes the information it receives. I confirmed that the button works independently, even without user input, although it will not output anything in such cases. Initially, I believed that implementing an "enter" event would not be an issue. However, despite numerous attempts, it still does not work as expected.
I have experimented with adding ng-keypress to the top div class and also tried placing it within the button tag. I have not attempted using a directive because I am unsure where to include it, and suggestions online indicate that ng-keypress should suffice.
<button class="btn btn-primary float-left" (click)="submitSearch()">Search</button>
</div>
<button class="btn btn-primary float-left" (click)="submitSearch()"ng-keypress= "submitSearch()">Search</button>
</div>
Despite including ng-keypress in the second line, nothing appears on the console upon pressing keys as anticipated.