This is a migrated thread and some comments may be shown as answers.

Routing on AngularJS + Kendo UI Mobile app

6 Answers 183 Views
HTML5, CSS, JavaScript
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Naomi
Top achievements
Rank 1
Naomi asked on 11 May 2015, 10:02 AM

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.

6 Answers, 1 is accepted

Sort by
0
Accepted
Tsvetina
Telerik team
answered on 13 May 2015, 12:14 PM
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.

 
0
Naomi
Top achievements
Rank 1
answered on 14 May 2015, 05:21 AM

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.

0
Accepted
Tsvetina
Telerik team
answered on 15 May 2015, 12:49 PM
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.

 
0
Naomi
Top achievements
Rank 1
answered on 17 May 2015, 06:56 AM

 

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.

0
Naomi
Top achievements
Rank 1
answered on 17 May 2015, 06:58 AM

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

Naomi.

0
Naomi
Top achievements
Rank 1
answered on 17 May 2015, 07:00 AM
Sorry, I tried again without '#' sign and it's work wonderful, thank you very much!!Naomi.
Tags
HTML5, CSS, JavaScript
Asked by
Naomi
Top achievements
Rank 1
Answers by
Tsvetina
Telerik team
Naomi
Top achievements
Rank 1
Share this question
or