Skip to content

lionel-meunier/selection

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Selection

Created by : Lionel Meunier

Angularjs directive add $selected variable in childscope to ng-repeat.

DEMO

Documentation

Include required librairie underscore.

Inject module into your app.

angular.module('App', ['lionel-meunier.selection']);

Developers

Using bower for install or clone repo.

Using

Repeat your list and add toggle link.

<ul>
	<li ng-repeat="item in list" selection="listSelected">
		<a ng-click="$selected!=$selected">Toggle</a>
		<span>{{item}}</span>
	</li>
</ul>

"listSelected" matches all items in the list that has "$selected" to true.

Filter

The filter "selectedOrdering" to sort the list of selection by keeping the order of the main list.

<ul>
	<li ng-repeat="item in list" selection="listSelected">
		<a ng-click="$selected!=$selected">Toggle</a>
		<span>{{item}}</span>
	</li>
</ul>
<ul>
	<li ng-repeat="item in listSelected | selectedOrdering : list">
		{{item}}
	</li>
</ul>

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published