I am using angular-bootstrap $modal and I have issue understand how to share data between a controller and the modal.
Controller:
app.controller 'MainController', ($scope, $templateCache) ->
$scope.openModal = ->
modal = $modal.open(
template: $templateCache.get('modal.html')
controller: modalController
size: 'sm'
resolve:
repository: ->
$scope.repository
)
Modal:
modalController = ($scope, $modalInstance, repository) ->
$scope.repository = repository
$scope.update = (other_repo) ->
$scope.repository = other_repo
$modalInstance.dismiss('cancel')
At this point I expect $scope.repository from MainController to be updated when it is changes from the modal, but it is not the case.
What am I missing?
Thank you