bonanza-ng

1.0.0 • Public • Published

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

Package Sidebar

Install

npm i bonanza-ng

Weekly Downloads

2

Version

1.0.0

License

MIT

Last publish

Collaborators

  • nescalante