Routing on AngularJS + Kendo UI Mobile app

7 posts, 2 answers
  1. Naomi
    Naomi avatar
    6 posts
    Member since:
    May 2015

    Posted 11 May 2015 Link to this post

    I am very new to AngularJS + Kendo UI Mobile. 

    How can I navigate to a page from angular controller?

    I try by this code:

    var App = $("#app").data("kendoMobileApplication");
    App.navigate("#menuCategories");

    but I get this error: "Error: [$rootScope:inprog] $digest already in progress"

    and about ngRoute I see: 

    "The mobile application instantiates and maintains its own routing mechanism based on the router component, which automatically matches and instantiates views when navigating. ... Note that AngularJS routing mechanisms are not supported"

    Thanks in advance

    Sorry for bad english ..

    Naomi.

  2. Answer
    Tsvetina
    Admin
    Tsvetina avatar
    1873 posts

    Posted 13 May 2015 Link to this post

    Hi Naomi,

    Note that in AngularJS applications you should not be instantiating a Kendo Mobile Application, as its routing mechanism will conflict with the AngularJS router. To correctly create a mobile application with Kendo Mobile and AngularJS, follow this tutorial:
    Tutorial: Building applications with Kendo UI Mobile and AngularJS

    As for navigation in code in AngularJS, check this Stack Overflow thread for instructions:
    How do I switch views in AngularJS from a controller function?

    Regards,
    Tsvetina
    Telerik
     

    Visit the Telerik Verified Plugins Marketplace and get the custom Cordova plugin you need, already tweaked to work seamlessly with AppBuilder.

     
  3. Naomi
    Naomi avatar
    6 posts
    Member since:
    May 2015

    Posted 14 May 2015 in reply to Tsvetina Link to this post

    Thank you for your reply!

    I already tryed this solution : $location.path(viewName)

    but this function based on the ngRoute module that  is not supported by kendo ui mobile as described here : 

    "The mobile application instantiates and maintains its own routing mechanism based on the router component, which automatically matches and instantiates views when navigating. ... Note that AngularJS routing mechanisms are not supported"

    So what can I do?

    Thanks again - 

    Naomi.

  4. Answer
    Tsvetina
    Admin
    Tsvetina avatar
    1873 posts

    Posted 15 May 2015 Link to this post

    Hello Naomi,

    Sorry for the confusion. What I meant is that you should not be instantiating a new kendo.mobile.Application object in code, which might have been irrelevant to your scenario.

    But you can define a kendo-mobile-application directive in the app wrapper (usually the body element). In this case you can use the kendo.mobile.application.navigate(url) method (you do not need to access the app instance) to perform navigation in code.

    Regards,
    Tsvetina
    Telerik
     

    Visit the Telerik Verified Plugins Marketplace and get the custom Cordova plugin you need, already tweaked to work seamlessly with AppBuilder.

     
  5. Naomi
    Naomi avatar
    6 posts
    Member since:
    May 2015

    Posted 17 May 2015 in reply to Tsvetina Link to this post

     

    Thank you very much for your reply!

    I tried your solution: kendo.mobile.application.navigate(url)

    but I get this error: "Error: [$rootScope:inprog] $digest already in progress"

    Thanks again-

    Naomi.

  6. Naomi
    Naomi avatar
    6 posts
    Member since:
    May 2015

    Posted 17 May 2015 in reply to Naomi Link to this post

    Sorry, I tried again without '#' sign and it's work wonderful, thank you very much!!

    Naomi.

  7. Naomi
    Naomi avatar
    6 posts
    Member since:
    May 2015

    Posted 17 May 2015 in reply to Tsvetina Link to this post

    Sorry, I tried again without '#' sign and it's work wonderful, thank you very much!!Naomi.
Back to Top