I want the search button to be disabled if there is no entry in the search field;
In my html file I have:
<div class="form-group">
<input type="text" class="form-control" ng-model"searchinput">
</div>
<button type="submit" class="btn" ng-click="search()" ng-disabled="disabled"> Search</button>
In my controller, I have:
if ($scope.searchinput == ""){
$scope.disabled = true;
}
This is not working. What am I doing wrong?
Calculate the length of
searchinput
if length is less than zero then simply disableand in your html