Skip to content

Instantly share code, notes, and snippets.

@pragmaticlogic
Created January 21, 2014 15:11
Show Gist options
  • Save pragmaticlogic/8541858 to your computer and use it in GitHub Desktop.
Save pragmaticlogic/8541858 to your computer and use it in GitHub Desktop.
angular.module('plunker', ['ui.bootstrap', 'angular.directives-round-progress']);
var ModalDemoCtrl = function ($scope, $modal) {
$scope.launchModalTimer = function () {
var modalInstance = $modal.open({
templateUrl: 'modalContent.html',
controller: ModalInstanceCtrl
});
};
};
// Please note that $modalInstance represents a modal window (instance) dependency.
// It is not the same as the $modal service used above.
var ModalInstanceCtrl = function ($scope, $modalInstance, $timeout) {
$scope.roundProgressData = {
label: 11,
percentage: 0.11
}
// Here I synchronize the value of label and percentage in order to have a nice demo
$scope.$watch('roundProgressData', function (newValue, oldValue) {
newValue.percentage = newValue.label / 100;
}, true);
$scope.ok = function () {
$modalInstance.close();
};
$scope.cancel = function () {
$modalInstance.dismiss('cancel');
};
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment