Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

angular-search

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

angular-search

A lightweight Angular search widget

  • 0.2.1
  • latest
  • npm
  • Socket score

Version published
Weekly downloads
4
increased by100%
Maintainers
1
Weekly downloads
 
Created
Source

angular-search Build Status Coverage Status

A lightweight Angular search widget

screenshot

dependencies

  • angular 1.x

features

  • lightweight
  • configurable behavior
  • supports both basic and pro user interactions
    • Click the loupe icon, press the word "Enter", or press the [ENTER] key to search
    • Press the "x" icon, or press the [ESC] key to clear a search
  • supports any number of search instances on one page
  • 100% test coverage

installation

# using bower:
bower install --save angular-search

# .. or, using NPM:
npm install --save angular-search

usage

<div ng-controller="mainCtrl">
	<search
		class="size-medium"
		param="searchText"
		placeholder="Search"
		search="search($param)"
	></search>
	<a ng-click="clear()">Clear</a>
</div>
angular
.module('demo', ['turn/search'])
.controller('mainCtrl', function ($scope) {

	angular.extend($scope, {
		searchText: '',
		clear: function() {
			$scope.searchText = '';
			$scope.search();
		},
		search: function (param) {

			...

		}
	});

});

options

<search
	<!-- css class(es) -->
	class="size-medium"

	<!-- disable the input when $scope.foo evaluates to true -->
	disabled="foo"

	<!-- param to update in the model when the user presses ENTER -->
	param="searchText"

	<!-- placeholder text when the input is empty -->
	placeholder="Search"

	<!--
		search function to call (passed the search string),
		should be defined on the controller's $scope
	-->
	search="fn($param)"

	<!-- submit onKeyUp rather than onSubmit -->
	typeAhead="true"
></search>

hacking on it

bower install
npm install
grunt watch

running the demo

bower install
npm install
node server/index

then open demo/index.html in a browser

running the tests

bower install
npm install
grunt test

Keywords

FAQs

Package last updated on 16 Mar 2017

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc