Skip to content

shammai/angulist

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 

Repository files navigation

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"};`

About

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

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published