Hi everyone,
I am brand new to ionic and pretty new to coding and so I thought I would ask you guys for some help.
I am trying to create an empty global variable (var choice={}). Then when the user clicks an item on a certain page in a list, the code assigns a specific text to the global variable such as ion-item href="book1.html" ng-click="choice="book1"" (not sure if this is even correct). Then this newly set global variable choice (which should be a string=book1) will be used to identify a certain object in an array in the controller such as listofarrays.choice.name or listofarrays.choice.price and so forth. The global variable needs to be assigned, passed, and then referenced by all of the different controllers. Please if anyone can tell me how this can be done or if there is another way to go about it. I would love to use a service for the variable and the arrays, but I don't know how to add one into ionic framework. Thanks in advance