Skip to content

Instantly share code, notes, and snippets.

@charandas
Last active August 29, 2015 14:02
Show Gist options
  • Save charandas/140341acbc49a8a3f97b to your computer and use it in GitHub Desktop.
Save charandas/140341acbc49a8a3f97b to your computer and use it in GitHub Desktop.
Modal instance controller that can support almost any modal view
var ModalInstanceCtrl = function ($scope, $modalInstance, heading, messages, size, extraParams) {
extraParams = extraParams || {};
$scope.heading = heading;
$scope.messages = messages;
$scope.size = size;
angular.extend($scope, extraParams);
$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