Questions tagged [durandal-navigation]

using the router plugin, and other navigation-related questions about DurandalJS

Related links

DurandalJS router plugin documentation: http://durandaljs.com/documentation/api.html#module/router

94 questions
2
votes
1 answer

durandal router.navigate not working

I need to navigate to another view from a event handler in my code, I do it like this define(['durandal/system', 'durandal/app', 'durandal/viewLocator', 'plugins/router', 'underscore'], function (system, app, viewLocator, router, _) { …
imgen
  • 2,803
  • 7
  • 44
  • 64
2
votes
1 answer

Conditional routing in Durandal

In my HotTowel based project, I'm using Durandal 1.1.1 for routing. I have a login route, which I want to activate if the user is not logged in. my route config is like: var routes = [ { url: 'login', moduleId: 'viewmodels/login', name:…
mehrandvd
  • 8,806
  • 12
  • 64
  • 111
2
votes
3 answers

Single Page App (SPA) with Durandaljs, Not Able to Load Default Route

I am trying to write a NopCommerce plugin. I have put in my app related files inside plugin's root directory in app named directory. In my shell.js viewmodel I define routes as follows: define(['durandal/system', 'durandal/plugins/router',…
TheVillageIdiot
  • 40,053
  • 20
  • 133
  • 188
1
vote
1 answer

Is it possible to suppress Durandal navigation?

My web application makes use of bootstrap, knockout and durandal. Below is a snippet of the rendered html, that defines a row with five columns. Irrelevant details are left out.
Cooz
  • 83
  • 1
  • 2
  • 10
1
vote
1 answer

Binding lifecycle called for the removed views on navigating to any route : Durandal

In my Durandal application, I have configured several parent routers and for some of it , there are child routers configured. The problem is, when the user navigates between different parent pages or the child pages, then binding lifecycle of the…
Senthil Kumar
  • 373
  • 1
  • 3
  • 8
1
vote
0 answers

How to handle back button after returning a promise from the activate callback in Durandal

We are developing a mobile application using Durandal 2.1 The documentation states that we can return a promise from the activate callback and it should cancel navigation on failure. We've been trying to use that feature, but it breaks the back…
KavenG
  • 161
  • 1
  • 9
1
vote
1 answer

Durandal activate, detached events of child router never get triggered

When using the following Durandal child router plugin configuration, I'm not getting the detached and activate events described in the Durandal lifecycle, while other events work. It is a single page application, with the childRouter controlling…
Peter G.
  • 7,816
  • 20
  • 80
  • 154
1
vote
0 answers

Parent's deactivate & activate is called on every child navigation

Recently we updated one of our applications from 2.0.1 to 2.1.0 and we're seeing some very different behavior with a child and grand child router. when we navigate between child routes in same parent, the parent's deactivate, activate then finally…
Pankajya
  • 109
  • 1
  • 5
1
vote
1 answer

Durandal child views not adding to history and being ignored when using the browser's back button

In a Durandal application I'm working on there's a page with tabs at the top which take the user into child views. These tabs work perfectly and are configured like so: var childRouter = router.createChildRouter() .makeRelative({ moduleId:…
James Donnelly
  • 126,410
  • 34
  • 208
  • 218
1
vote
0 answers

How can I have 'guardRoute' run before 'mapUnknownRoutes' in Durandaljs Router?

I'm using the Router in Durandaljs to control routing in a SPA. In my application all routes are created dynamically. Therefore I use only mapUnknownRoutes for mapping all routes. The problem I have is that if the user navigates between different…
beamish
  • 2,827
  • 3
  • 15
  • 16
1
vote
2 answers

How to display a "not found" page with parameterised route in Durandal

I have a Durandal application, and I use router.mapUnknownRoutes to display a user-friendly error page if the URL does not correspond to a known route. This works fine -- if I go to, say /foo, and that doesn't match a route, then the module…
leftclickben
  • 4,564
  • 23
  • 24
1
vote
1 answer

Splat Route Not Found (DurandalJS)

I have settings splat route configured in shell.js: router.map([ { route: 'settings*child', moduleId: 'views/settings/main', nav: true } ]).buildNavigationModel(); And inside the views/settings/main.js file i've created child router: var…
Fariz Azmi
  • 713
  • 1
  • 6
  • 21
1
vote
1 answer

How to go to a route without it being logged in browser history

I never want my logout route to show up the browser history. How can I configure the logout route to never log to the history. I know I can call activate(silent: true) but this doesn't solve my issue. This is how I am setting up my…
izikandrw
  • 1,703
  • 3
  • 14
  • 23
1
vote
1 answer

creating two navigation from the main nav in durandal

i have seen this question Durandal js router setup and would like to ask add a type within the durandal main navigation ... here is my code in shell,js define(function (require) { var router = require('plugins/router'); return { …
kabue7
  • 59
  • 2
  • 10
1
vote
1 answer

Durandal: how to call CanActivate() method

I am using HotTowel SPA template (with Durandal 2.0), and I am implementing the navigation based on user's credentials. For example, if user is a member of a particular domain group, he is allowed to see all the views, if not, only one view and so…