Mo.
Mo.

Reputation: 27465

Angular UI bootstrap typeahead ng-model says null when clear the filed

The filter works very well, but unfortunately the {{filterlist.name}} says null once removed the typed text and also tables looks empty because of null

Demo: https://plnkr.co/edit/1QVdctw1hr4ggJOtFHUZ?p=preview

<input type="text" class="form-control" placeholder="Name" 
  ng-model="filterlist.name" 
  typeahead-editable="false" 
  uib-typeahead="person.name as person.name for person in expenses | filter:{name:$viewValue} | limitTo:8">

Upvotes: 0

Views: 398

Answers (1)

Paritosh
Paritosh

Reputation: 11560

Check this Updated Plunk

I think you missed to declare the filterlist in the controller

$scope.filterlist = { name: '' };

I have put the {{}} part at the top of the table just for readability. Not sure why it was an issue for you. Works in Chrome for me

Upvotes: 1

Related Questions