Search code examples
angularjsangular-bootstrap

Angular bootstrap uib-typeahead


How do I set uib-typeahed result to uppercase from HTML view only. I don't care of any result from controller, but on the view it should be in uppercase.

Also, uppercase filter not working on it. Here is attached plunker.

Help me out, Thanks.


Solution

  • The answer provided by Ashish is good but if you want to make the UI consistent, you can refer this approach

    <input type="text" ng-model="selected"
        uib-typeahead="state.toUpperCase() for state in states  | filter:$viewValue | limitTo:8" 
       class="form-control">
    

    so that the selected value is also in Uppercase inside the input box