I have a scenario as follows :
I have one searchbox and the user can enter two types of queries
Scenario One the Search Starts with i.e. A1234 Scenario Two the search Starts with i.e. B1234
Depending on one or two above I want to hit a different webservice.
Whats the best way to distinguish the search on the above input. Is it when the user clicks on my ng-submit I use a regular expression ?
Or should I have a scope variable on .watch() to find out as the user is typing ?
<form role="form" ng-submit="searchForm.$valid && searchCode()" name="searchForm" novalidate>
<div class="input-group">
<input type="text" class="form-control" ng-model="searchQuery" name="searchQuery" required autocomplete="off" spellcheck="false" focus>
<input type="submit" value="Search" class="btn btn-default btn-sarch-bar">
</div>
</form>