Hassam Salam
Hassam Salam

Reputation: 266

Autocomplete in Ionic

I am new to ionic, I have started creating application on it. For last few days, I have been searching for autocomplete in ionic. I found a codepan but it's not that simple one. I need autocomplete just like JqueryUI provides.

Upvotes: 2

Views: 8134

Answers (4)

Jeremy
Jeremy

Reputation: 3809

If you are using Ionic 2+ and Angular 2+ then I recommend ionic4-auto-complete.

See a demo here.

Upvotes: 1

djose90
djose90

Reputation: 719

You can try with this.

  1. Install bower: npm install -g bower
  2. Then, run this on the project root: bower install ionic-autocomplete

  3. Add this attribute on the view

    <input type="text" ng-model="search" ionic-autocomplet="{item:myItems, onSelect: doSomthing}" />

  4. And finally, add this to your controller:

    .controller('MyCtrl', function($scope){ $scope.doSomthing = function(item) { console.log('The selected item is: '+item); } });

Reference : Bower library

Github : Example on Github

I hope this helps.

Upvotes: 0

Ramon-san
Ramon-san

Reputation: 1097

If you want an autocomplete like bootstrap typehead instead modal autocomplete of Guylabs you have allmighty-autocomplete. It is for angular, but I forked it and made some changes to fit it in Ionic.

Works fine but there is one issue if you put before a text input in a form. You can see that issue here: Clicks on div over an input in Ionic

Upvotes: 1

Zeeshan Hassan Memon
Zeeshan Hassan Memon

Reputation: 8325

There is a cool directive, Uptil now it's acceptable solution with 155 *s on github repo, try it:

Ionic directive - Autocomplete

Ionic directive - Autocomplete Website

Upvotes: 3

Related Questions