Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save BrianLian/9dd9e7102f93d2c17613212b4dbaa0b6 to your computer and use it in GitHub Desktop.
Save BrianLian/9dd9e7102f93d2c17613212b4dbaa0b6 to your computer and use it in GitHub Desktop.
angular uibModal resolve and resuts example
$scope.edit=(who,index)->
modalInstance = $uibModal.open
templateUrl: 'editModal'
resolve :
scheduleType : -> $scope.scheduleType
devices : ->$scope.devices
controller: [ '$scope', '$uibModalInstance', 'scheduleType', 'devices', ($scope, $uibModalInstance, scheduleType, devices)->
$scope.scheduleType = scheduleType
$scope.devices = devices
$scope.ui = {}
# Some Controller what you want
$scope.ok = ()->
$uibModalInstance.close $scope.ui
$scope.cancel = ()->
$uibModalInstance.dismiss('cancel')
]
.result.then (ui)->
$scope.schedule[index] = ui
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment