I have an input field that is a filter for a long list. Next to the input field is a search icon. Basically when the user starts typing, I need to change the icon class.
I have my text field setup like so:
<input type="text" ng-change="change()" ng-model="query" />
<button class="btn"><i class="icon-search"></i></button>
Inside my controller I have defined:
$scope.change = function()
{
//change the class of button based on the length of the input field
}
Not really sure how I go about determining if there is input in the field using angular and changing the class. Am I taking the right approach here? Thanks