angular-semver-sort
Angular.js filter for ordering collections by semantic version number.
Installation
bower install angular-semver-sort
If you’re building a Rails app, you can easily use it with Rails Assets—this package is available as rails-assets-angular-semver-sort
.
Usage
angular.module('yourApp', ['semverSort']);
semverSort
<ol>
<li ng-repeat="version in gem.versions | semverSort">
{{ version }}
</li>
</ol>
semverSort:property
<ol>
<li ng-repeat="gem in gems | semverSort:'version'">
{{ gem.version }}
</li>
</ol>
semverReverseSort
<ol>
<li ng-repeat="version in gem.versions | semverReverseSort">
{{ version }}
</li>
</ol>
semverReverseSort:property
<ol>
<li ng-repeat="gem in gems | semverReverseSort:'version'">
{{ gem.version }}
</li>
</ol>
Development
Clone the repository, then:
npm install
grunt
grunt test
Credits
The filter includes the browser build of node-semver, the BSD-licensed semver parser created by Isaac Z. Schlueter.
Made for Rails Assets.