durandal-navigation

Dynamic composition using knockout and durandal doesn't work

北战南征 提交于 2020-01-16 00:40:26
问题 I have a strange problem while using Durandal/Knockout. In some cases the binding doesn't work properly. I've simplified my situation which came in this question. I'm setting composition info somewhere in my code like: compositionInfo({ model: viewModelInstance, view: viewName, activate: viewModelInstance.activate }); And this is my view: <div id="service-container" data-bind="compose: { model: compositionInfo().model, view: compositionInfo().view, activate: compositionInfo().activate}"> At

Handling load timeouts of a view in a Durandal app

五迷三道 提交于 2020-01-04 03:30:12
问题 I've got a Durandal app that will periodically timeout when attempting to load a view. Here's an example timeout error: Error: Load timeout for modules: text!views/primaryapplicants.html http://requirejs.org/docs/errors.html#timeout If you lookup the provided URL, it suggests a few possible issues: Script error in listed module Path configuration incorrect Multiple module IDs map to the same file None of these are my issue. It is a real, genuine timeout. For some reason it wasn't able to load

How to dynamically display tabs for routes in Durandal?

风流意气都作罢 提交于 2019-12-20 04:31:13
问题 This is a two part question. Am very new to durandal and knockout. Using the HTML Starter Kit example for Durandal 2.0.1. I add a route for customers/:id with my own vm and view with nav = false { route: 'customer/:id', moduleId: 'viewmodels/customer/customer', nav: false } Because nav is false, it doesn't get used when buildNavigationModel() is called. So the shell.html doesn't show a tab entry for it. So far so good. When I navigate to c:\temp\index.html#customer/123 I can see the page, but

Conditional routing in Durandal

我与影子孤独终老i 提交于 2019-12-07 18:48:36
问题 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: 'Login', visible: true, caption: 'Login' },{ url: 'moduledetail/:id', moduleId: 'viewmodels/moduledetail', name: 'ModuleDetail', visible: true, caption: 'ModuleDetail' } I want if user want to go #/moduledetail/1 and is not authenticated yet, the browser

Conditional routing in Durandal

与世无争的帅哥 提交于 2019-12-06 13:41:48
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: 'Login', visible: true, caption: 'Login' },{ url: 'moduledetail/:id', moduleId: 'viewmodels/moduledetail', name: 'ModuleDetail', visible: true, caption: 'ModuleDetail' } I want if user want to go #/moduledetail/1 and is not authenticated yet, the browser navigate to route #/login/moduledetail/1 so after successful login route back to the #/moduledetail/1 . A

How to dynamically display tabs for routes in Durandal?

萝らか妹 提交于 2019-12-02 03:21:41
This is a two part question. Am very new to durandal and knockout. Using the HTML Starter Kit example for Durandal 2.0.1. I add a route for customers/:id with my own vm and view with nav = false { route: 'customer/:id', moduleId: 'viewmodels/customer/customer', nav: false } Because nav is false, it doesn't get used when buildNavigationModel() is called. So the shell.html doesn't show a tab entry for it. So far so good. When I navigate to c:\temp\index.html#customer/123 I can see the page, but it doesn't get included in the tabs at the top of the page. When I look at shell.html it uses data

Durandal 2.0 - Child routers intended for nested menus?

冷暖自知 提交于 2019-11-29 09:27:31
问题 I've building an app, and wanting to show a 2-tier menu, with both tiers always available. Durandal 2.0 introduced their new router, which supports 'child routers', which allow for easier deeplinking. My question - Can I have my 'child' navigation routes permanently loaded (and a sub menu rendered when the parent is not active), or is the 'child router' design intended to lazy-load them to evaluate them once a deeplink is to be evaluated? The Durandal examples show main navigation register a