0
votes

I have a kendo UI mobile app with angularjs. First view is a login view.

<body id="body" kendo-mobile-application k-hash-bang="true">
<kendo-mobile-layout k-id="'default'">
   <kendo-mobile-view id="login" k-layout="'default'" ng-controller="LoginController" k-on-show="init()"> ...

After a successful login I want to redirect to a specific view:

<kendo-mobile-view id="portfolio" k-layout="'default'" ng-controller="PortfolioController" k-on-show="init()">

function redirectAfterLogin() {
   var app = new kendo.mobile.Application(document.body);
   app.navigate("#!portfolio");
};

function redirectToLogin() {
   var app = new kendo.mobile.Application(document.body);
   app.navigate("#!login");
};

It works but when I call redirectAfterLogin() the debugger hits LoginController init() method and then PortfolioController init() two times.

1

1 Answers

0
votes

You can try using $location.path

In my applications, I went through a similar situation, when kendo or window navigation functions caused loops in controllers.