I\'m using the angular-ui modal directive http://angular-ui.github.io/bootstrap/ .
I have followed the example from the link above.
This is my data I want to
You can try something like
$scope.open = function () {
var modalInstance = $modal.open({
controller: 'ModalInstanceCtrl',
templateUrl: 'productDetail.html',
resolve: {
items: function () {
return ProductsFactory.getOneProduct();
}
}
});
};
Basically your $modal
can take a promise, so why not use it. Now the object should be available on the controller when the promise gets resolved. The ModalInstanceCtrl
should be
var ModalInstanceCtrl = function ($scope, $modalInstance, items) {
since you are resolving the items
property not the selectedProduct
property.