durandal

How can I use a class for my shell viewmodel in Durandal?

情到浓时终转凉″ 提交于 2019-12-04 23:47:05
问题 I'm having a look at the Hot Towel template, and trying to get it to work in TypeScript, I've encountered a problem converting the shell viewmodel. I'm trying to translate this into TS, and it makes more sense to me that it should be a class, rather than simply exporting functions as shown here. I looked at this approach but, paying attention to the comments here, decided against following it. After a bit of digging I found this thread, which suggested it should be as simple as overriding

Estimated Time Between two Locations in iOS [closed]

若如初见. 提交于 2019-12-04 22:07:03
What is proper way to get ETA (estimated time arrival) from AnyLocation to MyCurrentLocation? I want, when use tap on any annotation, then I have to set details on the Footer according to that annotation and user's current location. Please see below image for better understanding. I saw this What is proper way to get ETA (estimated time arrival) from any location to my current location and this calculate time taken to cover a journey in Apple Maps But they didn't solved my problem using this. I am getting always Null response using this. I put my code below:- double latitude = -0.075410;

Combining parameters, splat routes and child routers

痴心易碎 提交于 2019-12-04 19:52:20
We are trying to use route parameters alongside splat routes. This is the scenario. We have a navigation menu, and then as part of one of the options, we have a wizard. When we go to the wizard, we want to pass the identifier for the object we are working on. At the same, the wizard has steps and we want to handle those at the child level router, passing also the step as part of the route (*details). The splat route looks like this: { route: 'offer/:offerId/*details', moduleId: 'offerbuilder/index', title: 'Offer Builder' } The children routes look like this: [ { route: 'parameters', moduleId:

Pass data in DurandalJS to other view

元气小坏坏 提交于 2019-12-04 19:25:05
I'm developing a SPA webapplication with DurandalJS , but I don't understand something. Let's say I have page 1 and 2 . On page 1 there is a modal that creates a entity in the database with BreezeJS and gives back a key (that was generated in the database). I want to pass this fetched key and then go to my second page, page 2. I know how I can do this when I put it in the url http://localhost:60312/#/page2?orderid=2&repairorder=2 But this is not the way for Durandal , or is it? A user can enter a number of his own with al consequences! How can I solve this? As far as I know, the only seamless

Can Durandaljs do Areas

痞子三分冷 提交于 2019-12-04 14:07:06
问题 I'm trying to see if there is a way to do areas in Durandaljs Something along the lines of /App/areas/home /views /viewmodels /other /views /viewmodels I see the viewLocator allowing this convention: viewLocator.useConvention('viewmodels', 'views', 'areas'); but the router.useConvention() seems to default to same path. Is there a proper way to account for this, the documentation is light in this regard. 回答1: yes you can do this. Since you are using Durandal.router you can use a convention of

Durandal: How to route away from current view within that view's activate() function?

南楼画角 提交于 2019-12-04 13:53:32
问题 I have the following: function activate(routeData) { // make dataservice call, evaluate results here. If condition is met, reroute: if (true){ router.navigateTo("#/someRoute"); } alert ("should not be shown"); } The alert is getting hit however, and then the view changes. How do I fully navigate away from the current item and prevent any further code in that vm from being hit? Update: I tried using guardroute but I have to activate the viewModel to call the dataservice that returns the data

KendoUI integration into Durandal JS

烈酒焚心 提交于 2019-12-04 12:49:20
I'm building a phonegap application and plan to use Telerik's Kendo UI framework to generate the UI. Telerik Kendo UI already has an MVVM implementation and I'd like to use that and not include Knockout JS. Is this something that is supported, or is Durandal JS deeply integrated with Knockout? Roger Gullhaug has written a blog post, detailing how Durandal can be used together with Kendo UI's data binding: Using Durandal and KendoUI together Also the official Durandal documentation contains a mention about Kendo: KendoUI 来源: https://stackoverflow.com/questions/15409941/kendoui-integration-into

How to use the splat parameter in Durandal router?

半世苍凉 提交于 2019-12-04 11:41:47
The article I am looking at is Durandal Router . Under mapAuto , it says we can pass splat parameter in the url #/customers/1 . and the activate function in the viewmodel will be able to retrieve the parameter array. I built a route here router.mapRoute('view/:id', moduleId, 'Customer Details', false); But how can I obtain the id in the activate function? There is no example on the doc page. Please help us out. Thank you. Give your activate function a single parameter, perhaps named something like "data". The id that was passed into the url will then be available within the activate function

Use Twitter Bootstrap button group as radio select with knockout bindings

﹥>﹥吖頭↗ 提交于 2019-12-04 10:54:14
问题 This is working: view.html <div><input type="radio" name="radioPriority" data-bind="checked: priority" value="want" style="margin-top: -3px; margin-right: 3px;" />I want to</div> <div><input type="radio" name="radioPriority" data-bind="checked: priority" value="need" style="margin-top: -3px; margin-right: 3px;"/>I need to</div> controller.js function feedbackViewModel() { var self = this; self.priority = ko.observable("want"); //lots of other stuff } As expected, when you select the second

Integrate the koGrid with the Durandal/HotTowel template

时光总嘲笑我的痴心妄想 提交于 2019-12-04 09:25:27
问题 I work on an asp.net solution with the Durandal template. I try to use the koGrid (https://github.com/Knockout-Contrib/KoGrid) which is compatible with knockout. When inserting this grid in a test page managed by Durandal, it doesn't work: the grid seems to be there but not correctly displayed. We noticed that if we resize the window, then the grid adjust correctly. Does anyone already succeed integrate this koGrid in a Durandal/HotTowel template? Steps to reproduce the problem: Create a new