Ionic Modal Service issues with passing object to modal


#1

@julianpaulozzi I am hoping to you or anyone else can help me further as you have already given me a great head start with the service code you have written.

I have implemented it into a codepen where I display a list of exercises and when clicking on one of them I hope to pass the whole exercise object to the modal for furthers details to be displayed.

Specifically I need help with passing data to the modal. I use approximately 10 different modals in my project and would like to use the factory for all of them so being able to pass specific information to the modal is imperative.

Many thanks for your time.

Simon


#2

looking for something like this?


#3

@aaronksaunders thanks very much…

I ended up doing something like this where I pass $scope to the service and then I can display the data in the modal that I have set in the controller using $scope.activeExercise = {Obj}

Kind regards


#4

That will work also, but I like to decouple my services from a specific $scope so I try not to pass a $scope into a service as a parameter