Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save datalink747/3d9385d8ef6a3736f49d to your computer and use it in GitHub Desktop.
Save datalink747/3d9385d8ef6a3736f49d to your computer and use it in GitHub Desktop.
Angular - Bootstrap UI - Progress Bar
<div ng-app="myApp" ng-controller="progressBar" class="container">
<div class="page-header">
<h1><img src="https://s3-us-west-2.amazonaws.com/s.cdpn.io/15309/angular-logo.svg" alt="Angular.js Logo" width="50" height="50" /> Angular UI <small>Progress Bar</small></h1>
</div>
<progressbar class="progress-striped active" animate="true" max="100" value="progressValue" type="success"><i><span count-to="{{countTo}}" duration="1" count-from="{{countFrom}}"></span> / 100</i></progressbar>
</div>
var myApp = angular.module("myApp", ["ui.bootstrap","countTo"]);
myApp.controller("progressBar",function($scope,$timeout){
var amt = 66;
$scope.countTo = amt;
$scope.countFrom = 0;
$timeout(function(){
$scope.progressValue = amt;
}, 200);
});
// http://angular-ui.github.io/bootstrap/#/progressbar
// https://github.com/sparkalow/angular-count-to
<script src="//ajax.googleapis.com/ajax/libs/angularjs/1.3.2/angular.min.js"></script>
<script src="//angular-ui.github.io/bootstrap/ui-bootstrap-tpls-0.11.0.js"></script>
<script src="http://sparkalow.github.io/angular-count-to/js/angular-count-to.js"></script>
.progress {
height: 3em;
i { line-height: 3.5em; }
}
.progress-bar {
transition: width 1s ease-in-out;
}
<link href="//netdna.bootstrapcdn.com/bootstrap/3.1.1/css/bootstrap.min.css" rel="stylesheet" />
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment