Angular.js filter for ordering collections by semantic version number.
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
.
angular.module('yourApp', ['semverSort']);
<ol>
<li ng-repeat="version in gem.versions | semverSort">
{{ version }}
</li>
</ol>
<ol>
<li ng-repeat="gem in gems | semverSort:'version'">
{{ gem.version }}
</li>
</ol>
<ol>
<li ng-repeat="version in gem.versions | semverReverseSort">
{{ version }}
</li>
</ol>
<ol>
<li ng-repeat="gem in gems | semverReverseSort:'version'">
{{ gem.version }}
</li>
</ol>
Clone the repository, then:
npm install
grunt
grunt test
The filter includes the browser build of node-semver, the BSD-licensed semver parser created by Isaac Z. Schlueter.
Made for Rails Assets.