durandal

Thinktecture IdentityModel token rejected

北城以北 提交于 2019-12-25 04:05:15
问题 My Durandal SPA app performs BASIC authentication to acquire a session token which it then presents in headers to access Web API controller methods. This works fine. On successful authentication I cache the access_token in localStorage so I can re-acquire it from local storage to preserve the session in the event of browser closure or refresh. The token is re-acquired but it is rejected by the server with an Unauthorized message. This question starts by saying that the OP has successfully

JavaScript Durandal child viewmodel

假装没事ソ 提交于 2019-12-25 02:57:24
问题 I am using DurandalJS. My view welcome.html has a child view mymodule : welcome.html: <div> <!--ko compose: {model:'viewmodels/mymodule', activate: true}--> <!--/ko--> </div> The activate function is called in mymodule every time the view welcome.html is activated, as expected. But when the welcome.html is deactivated (I navigate to another view) the functions canDeactivate and devativate are not called in mymodule.js. How can this be fixed? 回答1: Using activate:true on the compose binding

div content not showing when html code moved to shell.html

旧时模样 提交于 2019-12-24 23:51:41
问题 I have downloaded a template from site: http://www.mosaicpro.biz/item/coral-app-website-startup-kit-18.html I am trying to integrate this into Durandal: when i keep the html content inside the file: Durandal->index.cshtml, everything works perfectly. But when i move the div content to shell.html, everything is shown as blank, nothing appears on the screen. i can see activate method of shell.js firing and there is no error in console. Also there is no code in activate which is hiding any

Navigation property no more working after migration of breeze 1.4.2

人走茶凉 提交于 2019-12-24 19:06:33
问题 I work with asp.net mvc with Durandal & breeze templates. I have the following code-first classes: 1st scenario: public class Transport { [Key] public int Id { get; set; } ... public int? SenderId { get; set; } public virtual SendRecv Sender { get; set; } } public class SendRecv { [Key] public int Id { get; set; } ... public virtual List<Transport> Transports { get; set; } } Then I can easily get all my related transports from my observable of type SendRecv : if (sendRecvs()[i].transports()

Why am I getting a TypeError when querying through breeze during a compose in durandal?

杀马特。学长 韩版系。学妹 提交于 2019-12-24 11:42:42
问题 I'm getting the following error from breeze and q.js when my view and model are being bound by a compose binding statement using durandal. I wrote the view in question in isolation and it works great until I try to do a compose binding with it, it throws this error. I tried moving all the custom properties from my entity constructor function to the initializer and also defering evalution of my computed's but that did nothing to thwart the error. I'm not sure which framework is causing this

Hot Towel SPA Durandal Knockout and Dynatree

﹥>﹥吖頭↗ 提交于 2019-12-24 11:27:45
问题 I am trying to get the dynatree control to work in the Hottowel viewmodel, based on this fiddle, http://jsfiddle.net/EZgNs var ViewModel = function() { var self = this; self.initialized = ko.observable(false); self.items = ko.observableArray(); // Use JSFiddle echo to simulate an AJAX service (function() { $.ajax({ url:"/echo/json/", data:data, type:"POST", success:function(data) { // Map the returned JSON to the View Model ko.mapping.fromJS(data, {}, self.items); self.initialized(true); } })

How to use Fancybox in combination with Durandal en TypeScript

与世无争的帅哥 提交于 2019-12-24 11:04:20
问题 I'm quitte busy prototyping and developing with the Hot Towel template from John Papa. Instead of using Javascript I'm using TypeScript and come a cross a problem. When the user click on a image in the SPA I want the image to pop out with fancybox. But for no way I can get this implemented. I thought I put my code for fancybox in de Activate function since thats called each time the view is loaded (I could be wrong here). But I also found out with Fiddler that de .js (the ModelView) is loaded

long ajax call breaking knockout binding

谁都会走 提交于 2019-12-24 07:31:35
问题 I am creating a personal website using durandal and knockout with the below code to bind a edit blog page. Everything worked great and I was able to bind the text area with the returned text of the ajax call. Once this was done I was curious if a long response from the webservice would break it, so I put in a Thread.Sleep(1000) into the service and now I cannot get it to bind the returned text to the text area. Any suggestions on how to get this to work??? side-note: I dont think this has to

Responsive Dialog in Durandal 2.1?

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-24 05:50:34
问题 I found the following: Responsive Durandal dialog However I don't see any documentation on making the dialog responsive in 2.1. I have a dialog that extends in height as the user selects stuff - eventually the dialog gets taller than the viewport and there's no scroll or anything so it's a total mess on mobile devices. I've tried using the "reposition" functionality from the docs but this doesn't seem to do much. Any advice around this would be much appreciated. dialog.show('viewmodels/doThis

Durandal Compose: activate method not always called

自作多情 提交于 2019-12-23 21:34:36
问题 In a SPA,I have a view in which I include another view using the compose binding. This sub view (child view) has an activate method which is called when the parent view is loaded. <div data-bind="compose: 'viewmodel/fol/index'"></div> However, when I navigate away from the parent view and then go back to it (without refreshing the browser), the activate method in the child view is not longer called. How can I force this to be called each time the parent view is loaded? 回答1: Since you are not