File Explorer Example

I am trying to use the File Explorer example within our app to access files and pictures that may be on the user's "phone," or in this case, computer.

I notice that the example uses handlers in order to show the screen, including a handler bound to "/main"

In the screen switching tutorial, we were instructed to use exports.screens between containers in order to switch between modules. Is there a way to adapt the handler model in order to behave like the exports? Ideally, I would like to have a button that takes the user to the file explorer-like screen, but I am unsure about how to integrate it as the file explorer seems to use handlers instead of containers.

Thanks!

Answers

  • The "exports" bit of code is only required when you are splitting your source code into multiple files. In that case you have to add each method to the "exports" module. If you take a look at the first code sample in that tutorial (which does the same thing as the latter example), you'll notice no "exports".

    Are you trying to put all the handlers into their own file? If so, you don't need to use the "exports" notation. Handler is a global variable that contains the bind() method. Because you're calling a method on an already declared object (and that method doesn't return anything) there is nothing to export back to the main source.

    Hope this helps!

    --Will

Sign In or Register to comment.