AngularJS Omni Bar

Native AngularJS multi-purpose bar you can use to display progress or completion.
Version: 1.0.0


{{value1}}%


  View on Github

Features

Usage

Include the required files
Load the omni-bar directive into your AngularJS app, such as:
var myApp = angular.module( 'myApp', [ 'isteven-omni-bar' ] );
In your view, set the directive as an attribute
... or as an element, but be careful with browser compatibility.
{{percentageValue}}
In your controller, set the percentageValue variable:
$scope.percentageValue = 39;
And that's it! You should now have the omni bar directive like what you see above (but without the animation).

Attributes / Options

Full spec
.. or ..
 
Below are the available attributes to configure the multi-select directive: * All CSS properties above are the same with jQuery's css() method format. Read more at http://api.jquery.com/css

Demo

1) Simple bar

This is a loading / progress bar you can use for almost anything.
Budget usage: ${{currentValue}} of ${{maxValue}}


$scope.currentValue = 700; $scope.maxValue = 1500; $scope.loadingCurrent1 = { backgroundColor: "#008080" }

2) Page loading bar

Look on top of the page. Missed it? Refresh your page and look again.
Note: This is just a simple, stupid page loading algorithm. Not really accurate. Use it at your own risk.

$scope.pageSize = 0; var pulse = $interval( function( pulse ) { $scope.pageSize = $scope.pageSize + 1; if ( $scope.pageSize > 98 ) { $scope.pageSize = 98; } }, 50 ); angular.element(document).ready(function () { $scope.pageSize = 100; $interval.cancel(pulse); }); $scope.loadingBarStyle2 = { position: "fixed", top: "0px", left: "0px", height: "3px", zIndex: "20" } $scope.loadingCurrent2 = { backgroundColor: "orange" }

Dependency

AngularJS v1.2.15. Other versions may or may not work. Please test first.

Browser Compatibility

Tested on:

Bug Reporting

Note

Licence

Released under the MIT license:

The MIT License (MIT)

Copyright (c) 2014 Ignatius Steven (https://github.com/isteven)

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE

More AngularJS Directives

Have a look on other directives I've created: