durandal

Perform a select and expand in the same query with breeze is not supported

亡梦爱人 提交于 2019-12-04 08:37:29
I develop an asp.net solution with Durandal/breeze. Here is my code to get all my shippers: var query = EntityQuery.from('Shippers') .select('id, name, street, city'); return manager.executeQuery(query) .then(querySucceeded) .fail(queryFailed); Here is the related model: public class Shipper { [Key] public int Id { get; set; } public string Name { get; set; } public string Street { get; set; } public string Number { get; set; } public City City { get; set; } } public class City { public int Id { get; set; } public string Name { get; set; } public string PostCode { get; set; } public Country

How to open a new tab with router.navigate in TypeScript

南楼画角 提交于 2019-12-04 08:02:52
The following typescript code will always open in the current browser tab navigate($data: menuItem, $event: JQueryEventObject) { //... let a = $event.currentTarget as HTMLAnchorElement; router.navigate(a.href); } How do I make router.navigate open in a new tab ? (that is when $event.ctrlKey is true) Yes, as you @Daneille commented, you have to handle by your own way since durandal's router plugin ( navigate function) does not provide a way to open a new tab. So it is better to handle something as you commented. if ($event.ctrlKey) { window.open(url); } I think it is better to do in HTML link

Durandal router / lifecycle events when using a childRouter

↘锁芯ラ 提交于 2019-12-04 07:30:47
In a single page app built using Durandal, I have a settings view, with different sections. I use a childRouter to resolve the different sections. In this application, a lot of code hooks into the composition lifecycle events that Durandal uses. For example, this custom binding: ko.bindingHandlers.autoFocus = { init: function (element) { var $element = $(element), setFocus = function () { $element.focus(); }; router.on('router:navigation:composition-complete', setFocus); ko.utils.domNodeDisposal.addDisposeCallback(element, function () { router.off('router:navigation:composition-complete',

Durandal SPA issues with typescript

谁都会走 提交于 2019-12-04 07:13:05
问题 I am updated my durandal SPA application from VS_2012 to VS_2015 with TypeScript 1.8 which will generate JavaScript (ECMA5). I resolved all build errors.But I am unable to fix one typescript error called "A 'return' statement can only be used within a function body" I am working on view models. So I need return statement out side of function. Due to build error I am not able to generate my java-script. Below is my sample code in Type script: class typescript1_8{ constructor(){ } } return new

KO cannot find template with ID

喜欢而已 提交于 2019-12-04 06:25:56
I've used Knockout templates before, so I'm not sure why this isn't working for me. I tried two different styles of ko markup, neither work. <!-- more nesting levels --> <div class="cal-day-tps" data-bind="foreach: timePeriods"> <div class="cal-day-tp-cont"> <div data-bind="template: { name: 'tp-ed-templ', data: $data }"></div> //both of these methods fail <!-- ko template: { name: 'tp-ed-templ', data: $data } --> <!-- /ko --> </div> </div> <!-- /more nesting levels --> <script type="text/html" id="tp-ed-templ"> <!-- bunch of markup --> </script> I just get the error "Cannot find template with

Knockout date validation not working correctly

末鹿安然 提交于 2019-12-04 05:21:33
问题 I need to validate date in localized format (SK) and it is not possible with knockout validation. I am using: Durandal 1.2.0 Knockout 2.3.0 Knockout validation https://github.com/Knockout-Contrib/Knockout-Validation I need something like this to be working: var newStartDate = ko.observable() .extend({ required: { message: 'Start date is required.' }, date: true, formattedDate: { format: 'ddMMyyyy', delimiter: '.' } }); Then if I call newStartDate.isValid() I get these results: newStartDate(""

MVC Durandal app only works in server root url

我怕爱的太早我们不能终老 提交于 2019-12-04 04:21:26
问题 When I create a project from the Visual Studio 2013 Durandal template and run the project, it serves a working instance of the Durandal Starter Kit web out of my development web server. When I deploy this to an IIS Web Application, it gets as far as the splash screen, and there it stalls. Fiddler reveals a 404 trying to GET /App/main.js HTTP/1.1 which clearly is the reason it stalls. This brings us to the question: presumably there are settings requiring attention, but what and where? This

durandal optimizer references wrong path when building it as a post build process in Visual Studio

守給你的承諾、 提交于 2019-12-04 02:00:27
问题 i set up a post-build event in visual studio to use durandal's optimizer (which uses nodejs) to build the main-built.js file for production. getting an error saying it can't find main-built.js. i believe this is because it's not referencing my project properly. my base directory is at c:\projects\myapp\myapp. it's only looking for the durandal directory from c:\projects\myapp. is there a way to tell it the correct directory? here's some of the output. if 'Release'=='Release' C:\Projects\myapp

How to pass data (selected item) to Durandal composed detail view?

為{幸葍}努か 提交于 2019-12-03 17:45:45
问题 I've started using (as of, a few hours ago) Durandal with the hope to manage views and allow composition within a single page - the previous approach, also using Knockout, was getting too unwieldy to maintain in a fat HTML file. I've installed/setup Durandal and I can create views and viewmodels - however, I don't know how to get data into the viewmodel to use as a basis for the new viewmodel. For instance, I have a "left nav bar" for selecting items - when an item is selected it updates a

Durandal and MVC4 Areas for multiple SPAs

喜你入骨 提交于 2019-12-03 13:34:18
问题 I have a internet application mvc4 with areas, for my organization each area represent a SPA and through "Manage NuGet Package" I installed "Durandal 1.2.0", "Durandal Transitions 1.2.0" and "Durandal Router 1.2.0". I organized the folders and quit the "views" and "viewmodels" from folder "App" of Durandal and put the new views in folder "VIews" of mvc4 area for example: Areas-->NewArea-->Views-->ControllerFolder-->views-->shell.html Then I put the '"viewmodels" in "Script" folder for example