angulist

angulist is an AngularJS module for using the HTML5 datalist element as an autocomplete module within your page.

Homepage

Added by: Sam Deering

GitHub

Repository

shammai/angulist

Stats

Stars: 0

Watchers: 0

Forks: 0

Author

Shammai
Shammai

Module Description

angulist

angulist is an AngularJS module for incorporating AngularJS DataList in your page.

This module acts like an autocomplete directive.

Angulist takes an array of objects and creates a datalist element. When the user selects an item from the list angulist will set the object that matches that item into a return object for use on the rest of your page.

Assuming the following variables:

var myObj = {};
var myId = "myid";
var optiontextfield = "Name";
var objectArray = [{"Name":"Test Name 1", "Value":"1234"},{"Name": "Test Name 2","Value":"5678"}];

Example Syntax:

<angulist returnObject="myObj" inputid="myId" optiontextfield="objName" localdata="objectArray" inputclass="form-control form-control-small" />

The generated output would be:

<input id="myId" class="form-control form-control-small" ng-model="returnValue" list="myId-list"> <datalist id="myId-list"> <option>Test Name 1</option> <option>Test Name 2</option> </datalist>

If the user selects the second option the returnObject value would be:

returnObject = {"Name":"Test Name 2", "Value": "5678"};

Module stats last updated: 2015-04-19 02:57:15

Disclaimer: Some data on this page may have been gathered from the authors GitHub respository. If you see any mistakes or outdated information please let us know. Thanks!