#boolean-search
A javascript library for evaluating boolean search terms provider for Angular.js applications. ngBooleanSearch is small (~7Kb), has minimalistic API and has only Angular.js as a dependency.
You can use a following string to filter objects, where title is a property of object and search me
can be a value of any property of this object.
search me title: awesome and cool or great
You can download all necessary ngBooleanSearch files manually or install it with bower:
bower install ngBooleanSearch
You need only to include ngBooleanSearch.js
to your project and then you can start using ngBooleanSearch
provider in your directives, controllers and services.
Register ngBooleanSearch module at your application
var app = angular.module('exampleApp', ['ngBooleanSearch']);
app.controller('MainCtrl', function ($scope, ngBooleanSearch) {
});
and then at your filter function
$scope.searchTextFn = function(actual, search){
return ngBooleanSearch.filterBookmark(item, search);
};
ngBooleanSearch service provides easy to use and minimalistic API, but in the same time it's powerful enough. Here is the list of accessible methods that you can use:
Method allows to generate expression tree by a search string and allows not to create a new instance on each call. It accepts searchText
string as the only argument.
Method allows to filter object by search text with boolean expression. It accepts bookmark
object as the first argument and searchText
string as the second one.
You need this section only if you are interesting in updating current docset or build your own docset generator based on this.
- Clone this repository.
- Install node.js.
- Install bower.io
npm install -g bower
. - Download all npm dependencies with
npm install
(invoking from root project folder). - Download all bower dependencies with
bower install
(invoking from root project folder). - Launch
gulp test
command to run all test and check that everything is correct.
Apache License, Version 2.0