I have two service methods
getObject: function (url, id) {
var defer = $q.defer();
$http({method: 'GET', url: url+'/'+id}).
success(function (data, status, headers, config) {
defer.resolve(data);
})
.error(function (data, status, headers, config) {
defer.reject(status);
});
return defer.promise;
},
openModal: function (objid, templateUrl) {
var modalInstance = $modal.open({
templateUrl: templateUrl
controller: 'ModalInstanceCtrl',
});
return modalInstance.result
},
Now i want that when call openModal function with id
then i need to call self.getObject(id) then grab the object and then pass it to ModalInstanceCtrl