Created
August 5, 2016 07:27
-
-
Save IS-BrianLian/9dd9e7102f93d2c17613212b4dbaa0b6 to your computer and use it in GitHub Desktop.
angular uibModal resolve and resuts example
This file contains hidden or 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
$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