Router - redirect to view - angular

10 posts, 0 answers
  1. Casimodo
    Casimodo avatar
    71 posts
    Member since:
    Mar 2015

    Posted 15 Jun 2015 Link to this post

    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

  2. Petyo
    Admin
    Petyo avatar
    2439 posts

    Posted 17 Jun 2015 Link to this post

    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!
     
  3. Kendo UI is VS 2017 Ready
  4. Casimodo
    Casimodo avatar
    71 posts
    Member since:
    Mar 2015

    Posted 17 Jun 2015 in reply to Petyo Link to this post

    @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

  5. Casimodo
    Casimodo avatar
    71 posts
    Member since:
    Mar 2015

    Posted 17 Jun 2015 in reply to Casimodo Link to this post

    @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?

  6. Casimodo
    Casimodo avatar
    71 posts
    Member since:
    Mar 2015

    Posted 17 Jun 2015 in reply to Petyo Link to this post

    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.

  7. Casimodo
    Casimodo avatar
    71 posts
    Member since:
    Mar 2015

    Posted 17 Jun 2015 in reply to Petyo Link to this post

    @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.

  8. Casimodo
    Casimodo avatar
    71 posts
    Member since:
    Mar 2015

    Posted 18 Jun 2015 in reply to Casimodo Link to this post

    OK. I've given up. Back angular's $location.hash navigation.
  9. Petyo
    Admin
    Petyo avatar
    2439 posts

    Posted 19 Jun 2015 Link to this post

    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!
     
  10. Casimodo
    Casimodo avatar
    71 posts
    Member since:
    Mar 2015

    Posted 19 Jun 2015 in reply to Petyo Link to this post

    @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

  11. Petyo
    Admin
    Petyo avatar
    2439 posts

    Posted 23 Jun 2015 Link to this post

    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!
     
Back to Top
Kendo UI is VS 2017 Ready