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

Router - redirect to view - angular

9 Answers 178 Views
SPA
This is a migrated thread and some comments may be shown as answers.
Casimodo
Top achievements
Rank 1
Casimodo asked on 15 Jun 2015, 06:40 PM

Hi,

Can you help me with my dojo here? In this experiment I'm trying to redirect to the login-view. Doesn't work, neither in the change event nor in the route callbacks. Plus using the change event produces an infinite loop (on FF38).

Regards,

Kasimier Buchcik

9 Answers, 1 is accepted

Sort by
0
Petyo
Telerik team
answered on 17 Jun 2015, 07:39 AM
Hi,

please check an updated version of your dojo

Regards,
Petyo
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
0
Casimodo
Top achievements
Rank 1
answered on 17 Jun 2015, 12:27 PM

@Petyo,

thank you for trying to help me, but there are some issues with this approach:

1) It freezes my firefox when I run it and click on the tap strip

2) We would need to add this workaround to every view and every controller. That's what the router should be for.

3) It does not use Kendo's router

Maybe someone can clarify why the router doesn't work in this scenario?

Regards,

Kasimier Buchcik

0
Casimodo
Top achievements
Rank 1
answered on 17 Jun 2015, 02:27 PM

@Petyo,

Using your dojo: I managed to get rid of my firefox freeze.

Did you notice that the tab strip is not reflecting the view being redirected to?

0
Casimodo
Top achievements
Rank 1
answered on 17 Jun 2015, 03:06 PM

I debugged the kendo.mobile.js code and learned that in "kendo.mobile.js" _startHistory() is called by the bootstrapper funtion of the kendo Application. Here a new kendo.Router is already created. I think my scenario won't work because effectively I have two routers flying around and messing things up.

So the question is: how/where/when do I register my routes and the change callback on the already created router of the application object? I need to have access to angular's $rootScope in those functions.

0
Casimodo
Top achievements
Rank 1
answered on 17 Jun 2015, 05:36 PM

@Petyo, I can now reproduce the firefox freeze in your dojo. If one clicks fast multiple times on the tab strip, then firefox freezes. Doesn't happen every time, so give it some seconds. This might be a timing issue.

0
Casimodo
Top achievements
Rank 1
answered on 18 Jun 2015, 10:27 AM
OK. I've given up. Back angular's $location.hash navigation.
0
Petyo
Telerik team
answered on 19 Jun 2015, 07:43 AM
Hi Kasimier,

I would like to point out couple of things:

- Kendo UI Mobile does not officially support the Firefox browser. 
- The router of the mobile application is exposed as a field.
- The approach you have taken (using the router methods explicitly for navigation) is not very common one. However, you may fully facilitate it by disabling the mobile app router, and navigating manually. 

Regards,
Petyo
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
0
Casimodo
Top achievements
Rank 1
answered on 19 Jun 2015, 09:44 AM

@Petyo,

thanks for the information. I appreciate it.

Regarding the freeze on fast mouse clicks in FF: I think this is more of an exotic issue, because my mouse button is broken and produces fast double-clicks randomly. To be precise, bits of tobacco found their way into the mechanics :-)

I reverted to using angular's $location. Probably this approach will produce other problems on my way, but it works for the current state of our application. I will revisit kendo's navigation when $location falls apart for me.

Feature request: It would be great if Kendo UI Mobile would provide a built-in mechanism for the authorization scenario, which should be a common scenario. A simple redirection-callback somewhere on the Application would be great.

Sidenote: I tried to get hold of the Application's router. This turned out to be tricky because the router is created at a very late stage. I modified kendo's code to create it earlier and used the widget-creation event to get hold of it. But at the end using the Application's router didn't work either. The machinery was just not designed to support what I wanted.

Regards,

Kasimier Buchcik

0
Petyo
Telerik team
answered on 23 Jun 2015, 07:10 AM
Hello Kasimier,

the scenario you describe (decoupling the router from the mobile app) is fully supported - I linked the configuration option in my previous post. Afterwards, you would be able to use angular $location or the kendo ui router, and navigate the mobile app manually. 

In case you decide to go with that implementation and need further assistance, please let us know. 

Regards,
Petyo
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
Tags
SPA
Asked by
Casimodo
Top achievements
Rank 1
Answers by
Petyo
Telerik team
Casimodo
Top achievements
Rank 1
Share this question
or