bonanza-ng
v1.0.0
Published
Angular autocomplete directive using bonanza
Downloads
5
Maintainers
Readme
Bonanza ng
Angular autocomplete directive using Bonanza
Install
Use it as an npm package:
npm install bonanza-ng --save
Or just download it from bower
bower install bonanza-ng --save
Usage
Use it over an input
<input type="text"
ng-model="owner"
bonanza
bonanza-request="getUsers($query)"
bonanza-label="firstName + ' ' + lastName"
bonanza-item-label="firstName + ' ' + lastName + ' (' + email + ')'"
bonanza-on-select="ownerChanges = ownerChanges + 1"
bonanza-is-loading="loadingUsers">
You will have to define in the controller a function for the request:
$scope.getUsers = function (query) {
return usersResource
.get(query)
.$promise;
};
Ensure that the function returns a Promise.
License
MIT