Giter VIP home page Giter VIP logo

ng-searchinput's Introduction

ng-inputSearch

Angular advanced search component ( Use Angular 1.3 )

Example

Here


## Functionnality
  • delete search button
  • search button
  • search partial when a minimum of char appears
  • close partials results with click outside the results ( for desktop & tablet ) or with Esc Key ( for desktop )
  • Use Key up and Key Down for navigate between partials results
  • Action on Enter key when a partial result is selected
  • Tablet Friendly

Installation

Easy Way :

$ bower install ng-InputSearch

Installation is easy as angular-ui-bootstrap has minimal dependencies - only the AngularJS and Bootstrap's CSS are required. Two versions are available :

  • ng-inputSearch-tpls.min.js
  • ng-inputSearch.min.js

For people who want to take all the directives and don't need to customize anything the solution is to grab a file named ng-inputSearch-tpls.min.js.

If, on the other hand default template are not what you need you could take ng-inputSearch.min.js and provide your own templates, taking the default ones in template directory.

Html code Loader

    <link href="ng-inputSearch.min.css" rel="stylesheet" />
    <link href="bootstrap.min.css" rel="stylesheet" />
    <script src="//angular/angular.min.js"></script>
    <script src="//ng-inputSearch[-tpls].min.js"></script>

## Angular configuration
    angular.module('myApp', ['ng.inputSearch'])

## Example
    <search-bar
        max-results="5"
        search-button="searchButton()"
        search-partials="searchPartials()"
        action-on-element="actionOnElement(id)"
        search-query="searchQuery"
        results="results"
        min-char-search="3"
        >
        </search-bar>

    controller:function($scope){
        $scope.searchButton = function(){
            ...
        }    
        $scope.searchPartials = function(){
            ...
        }
        $scope.actionOnElement = function(id){
            ...
        }
    }

Attribute :

  • max-results : "5" (default), // Number of results appears for partials results
  • search-button : "", // Function executed when the users click on the search button (required)
  • search-partials : "", // Watch search input and execute "search-partials" function when "minCharSearch" chars are present, wait 300ms after each change to execute action (required)
  • action-on-element : "", // Action executed when users select it ( by click or with enter key ) -> Use ID on element but not necessary
  • search-query : "", // the search element used by previous function (required )
  • results : "", // results of the search (required)
  • min-char-search : "3" (default), // minimum carac before search-partials is executed

Customize templates (only with tpls)

You might want to customize default templates to match your desired look & feel, add new functionality etc.

The easiest way to override an individual template is to use the directive:

    <script id="template/searchinput/element.html" type="text/ng-template">
        <div>
            {{element.name}}
        </div>
    </script>

ng-searchinput's People

Contributors

smurf81 avatar

Stargazers

Eder Oliveira avatar Chris Lonardo avatar Xinyang (Darren) Li avatar  avatar

Watchers

James Cloos avatar  avatar

ng-searchinput's Issues

Feature: grouping

There is currently no real search component that allow grouping of results (only ui-select2 or bootstrap typeahead does it). It would be usefull to implement this features, with possibility to have a different row template per group.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.