Search code examples
cordovasteroidsappgyversupersonic

AppGyver sharing data across views in a MPA


I have a search form that is being used to query a database. I'm able to get the data returned so I can display it on the same view that it's being queried from, but I'd like to display the data on a results page, and then be able to display a single entry with more information about it.

I've reviewed the docs and so far I've been unable to make any of their methods work for what I'm doing.

If it matters, all of my attempts have been with an Android phone using the scanner app. If someone knows of an example application that I can look at to see how data-sharing should be implemented, I would appreciate it.


Solution

  • I have got the publish subscribe pattern working most of the time. The only catch would be that subscribing view should already be loaded. (Either pre-loaded or manually loaded). Never got the superscope approach working. One thing that always worked for me is the localstorage method. One can always do a

    localStorage.setItem("readitems", JSON.stringify(localreadItems));
    

    and

     var readitems = JSON.parse(localStorage.getItem("readitems"));