Skip to content

nishant8BITS/angular-livesearch

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

37 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

angular-live-search

##Usage

Markup

<div ng-controller='MyController'>
<live-search id="search1" type="text"
  live-search-callback="mySearchCallback"
  live-search-item-template="{{result.city}}<strong>{{result.state}}</strong><b>{{result.country}}</b>"
  live-search-select="fullName"
  ng-model="search1" ></live-search>
</div>

Controller

//define app module with dependency
var app = angular.module("MyApp", ["LiveSearch"]);
app.controller("MyController", function($scope, $http, $q, $window) {
   $scope.search1 = "";
   //your search callback
   $scope.mySearchCallback = function () {
      var defer = $q.defer();
      defer.resolve([
        { city: "nailuva", state: "ce", country: "fiji"},
        { city: "suva", state: "ce", country: "fiji"}
      ]);
      return defer.promise;
   };
});

Example

Demo on Plunker

Working...

About

An angular directive for auto-completing

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 91.2%
  • CSS 4.5%
  • Shell 1.9%
  • HTML 1.5%
  • Other 0.9%