2 Replies Latest reply on Dec 23, 2013 11:24 AM by Steve Gardner

    Does Rho.ORM.addModel work in a regular browser?

    Steve Gardner

      I am trying to call the ORM from Javascript for Angular, following the example at  https://github.com/javiermolina1234/rhomobile-angular-sample.

       

      The following code seems to work sometimes in the Rho Simulator, but never in Chrome, Firefox or IE.

       

          var rhoProductModel = Rho.ORM.addModel(function(model) {

                  model.modelName("Product");

                  // Uncomment for RhoConnect integration

                  // model.enable("sync");

                  model.property("name", "string");

                  model.property("brand", "string");

                  model.set("partition", "app");

          });

       

      In Chrome I get the following error: "Uncaught SyntaxError: Unexpected token o "

       

      I've seen people suggesting that this means that a reference to "/public/api/rhoapi-modules.js" is missing, or that the order of than and jquery is wrong, but I have tried all permutations of those files and still see the error.

      I've also seen people suggesting that the application still functions correctly, but in my case and subseqeuent lines of javascript fail to execute because of the error.

       

      I get this error if I write the code myself, or if I run the example downloaded from the link above.

      Has anyone been able to get the add Model code from the example to work in a regular browser?  I'm not keen on a solution that only works in RhoSimulator.te

       

      Thanks
      Steve