I\'d like to edit some data from a table using a modal. There are various interfaces in the typescript definitions for angular-ui-bootstrap from definitelyTyped, however they ar
Am I right to assume that both ItemsListController and ItemDetailModalController need an instance of the same scope in order to exchange the data?
Yes. I actually think of modals as an extension of ItemsListController
containing members shownDetails:ItemDetailModalController
. Which means you don't need to come up with a messy way of sharing $scope
as its just a single $scope
.
And how can I define the controller and the template for the modal directive using the interfaces above?
This is what I have (note that you are sharing the scope):
this.$modal.open({
templateUrl: 'path/To/ItemModalDetails.html',
scope: this.$scope,
})
Where $modal:IModalService
corresponds to what angular strap gives you : http://angular-ui.github.io/bootstrap/#/modal