How can I view nodes on my site from Drupalgap? I am getting started with Drupalgap and trying to access nodes on my Drupal site by node ID from within Drupalgap.  I have checked the Node and Node Services documentation.  I thought I could use the node_page_view(nid) function like this:

function mymodule_sample_page() {
  try {
    node_load(11, {
        success:function(node){
        alert("Loaded " + node.title);
      }
    });
    return node_page_view(11);
  }
  catch (error) { console.log('mymodule_sample_page - ' + error); }
}


However, when I attempt to test this in my module, I get the alert "Loaded your node" but the content is not actually displayed on the page by node_page_view().  What do I need to do to display the content?
In mymodule_sample_page() just return an empty div container, for example:

&lt;div id="my_node_11"&gt;&lt;/div&gt;

Then attach a pageshow handler to your page via hook_menu(), then in the pageshow handler call node_load(), and in its success inject the content into your empty div container.

The page_callback can not have any async calls in it, as all async calls have to be handled after the page is actually shown.

FYI, DrupalGap has built in support to view nodes, just navigate to node/11 in the app. Here's a brief example demonstrating pageshow: http://www.drupalgap.org/node/154