passman/js/app/directives/progressbar.js

32 lines
945 B
JavaScript
Raw Normal View History

2016-10-08 01:56:29 +08:00
(function () {
'use strict';
/**
* @ngdoc directive
* @name passmanApp.directive:passwordGen
* @description
* # passwordGen
*/
angular.module('passmanApp')
2016-10-13 02:12:28 +08:00
.directive('progressBar', [function () {
2016-10-08 01:56:29 +08:00
return {
restrict: 'A',
template: '' +
'<div class="progress">' +
'<div class="progress-bar" role="progressbar" aria-valuenow="{{progress}}"aria-valuemin="0" aria-valuemax="100" style="width:{{progress}}%;" use-theme>' +
2016-09-14 05:03:12 +08:00
'<span class="sr-only">{{progress}}% Complete</span>' +
2016-10-08 01:56:29 +08:00
'<span ng-if="index && total" class="progress-label" use-theme type="\'color\'" color="\'true\'">{{index}} / {{total}}</span>' +
'<span ng-if="!index && !total" class="progress-label" use-theme type="\'color\'" color="\'true\'">{{progress}}%</span>' +
'</div>' +
2016-09-14 05:03:12 +08:00
'</div>',
2016-10-08 01:56:29 +08:00
scope: {
progress: '=progressBar',
index: '=index',
total: '=total'
},
2016-09-14 05:03:12 +08:00
2016-10-13 02:12:28 +08:00
link: function () {
2016-09-14 05:03:12 +08:00
2016-10-08 01:56:29 +08:00
}
};
}]);
}());