Hi,
I have an ion-view where a there is a list of element:
Apple
Banana
Orange
…
When I touch and hold one of the element, I want my modal gets the element information (ex: apple)
Is it possible to do that with a modal? If so, how can I do it?
My code in the controller looks like this and don’t know where I could push “fruit” into the modal
vm.onHold = function(fruit) {
// do something
console.log("hold " + fruit.name);
$scope.editFruitNameModal.show();
};
// Create and load the Modal
$ionicModal.fromTemplateUrl('views/editFruitName.html', {
scope: $scope,
animation: 'slide-in-up'
}).then(function(modal) {
$scope.editFruitNameModal = modal;
});
// Called when the form is submitted
$scope.editFruitName = function(fruit) {
console.log("edit fruit");
$scope.editFruitNameModal.hide();
// Save new fruit name
};
// Close the edit fruit modal
$scope.closeEditFruitName = function() {
$scope.editFruitNameModal.hide();
};
Hope that I was clear
Thanks in advance!