Created
January 21, 2014 15:11
-
-
Save pragmaticlogic/8541858 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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