2 Replies Latest reply on Nov 27, 2013 7:25 AM by Rutger van Eerd

    JavaScript MVC (Angular, Backbone) not working on Windows Mobile devices

    Rutger van Eerd

      Hello,

       

      I am having trouble getting JavaScript MVC frameworks AngularJS and Backbone.js working on actual devices, esp. Windows Mobile.

       

      The Angular sample does work on an Android phone but does not work on a Windows Mobile 6.5 device. It just shows the static HTML and does not seem to do anything with the Angular code (views, templates). The same on the Windows Mobile emulator.

       

      The Backbone sample works in RhoSimulator but immediately gives the following error on all devices I tried (Android phone, Windows Mobile device, Windows Mobile emulator):

       

      404 Not Found

      The file /app/index.erb was not found.

       

      This all of course with RhoStudio 4.0.0.

       

      Maybe I am missing some configuration or build setting?

        • Re: JavaScript MVC (Angular, Backbone) not working on Windows Mobile devices
          Rutger van Eerd

          I finally got JavaScript MVC working on a Windows Mobile. I used to get an error that RhoMobile could not load Config.xml similar to this thread. I tried using the shared runtime and this solved the Config.xml error and also magically JavaScript MVC now worked.

           

          I reverted to not using the shared runtime and did a clean boot of the device. After this, also no Config.xml error and JavaScript MVC working like a charm.

           

          I can now also see the following in rholog.txt. Not sure if it was there before:

           

          I 01/01/2009 00:26:49:000 ed63dd0e              RhoRuby| require_compiled: motoapi/elements

          I 01/01/2009 00:26:51:000 cd57b8d2    Core::Initialise| RhoElements is using Config file: \Program Files\angular\Config/Config.xml

          I 01/01/2009 00:26:51:000 cd57b8d2 CAppManager::CAppManager::Init| Engine is use is the Motorola WebKit engine (default)

          I 01/01/2009 00:26:51:000 cd57b8d2    Core::CApp::Init| Regular Expressions will not be applied to EMML Tags

          I 01/01/2009 00:26:51:000 cd57b8d2    Core::Initialise| RhoElements Component Version: RhoElements Runtime = 4.0.0.0.0

           

          Probably something was not correctly setup or configured on the device and the clean boot fixed this.

           

          Also to get the Angular sample working I had the change the layout.erb file. The relevant JavaScript files were loaded in the part where also jQuery Mobile etc are loaded. However this code is never executed for Windows Mobile/CE because of the Ruby "if" statement. I removed the "if" statement but you can also move the relevant <script> tag.