exxeta-search v1.0.0
exxeta-search web component
This is an example of a Polymer Web Component that implements a search component for finding entries by a given property and search term in an array.
To get this web component working you need to get the webcomponent.js polyfill with
npm install webcomponent.js --save
then include webcomponent.js as you would any other script tag.
<script src="node_modules/webcomponentsjs/webcomponents.js"></script>
To get the web component itself you need to run
npm install exxeta-search --save
in your console and then add the following link tag to your project.
<link rel="import" href="node_modules/exxeta-search/components/exxeta-search.comp.html">
Then, you can start using the <exxeta-search>
element as any other HTML element in your page.
Input parameters, through attributes:
data
(required): The array to search in.property
: The property to search for, if no property or 'all' is provided the web component searches through all properties of the objects.query
(required): The search query's keywordslimit
: The maximum number of objects to return, default is 8.
The search results are available in an exposed result
property.
7 years ago