durandal

link to another controller with hot towel and durandal

喜欢而已 提交于 2019-12-05 21:31:33
I am developing an mvc4 app with multiple spa's. I am using the hot towel template for my spa. What I want to do is have a anchor link within my views for a spa go to the index action for another controller, so my users can exit one spa and open another. Not all actions will start a spa some are regular mvc style pages. I have put code like like the following in my spa html pages: <a href="/controller/action">Navigate to another controller</a> This will change the url in the browser but always reloads the default html page for the spa. If I hit the refresh button in the browser then if will go

Self-referencing many-to-many relationship EF code first

限于喜欢 提交于 2019-12-05 17:39:02
I work with ASP.NET MVC With Durandal/Breeze templates. Let's say I have the following class: public class Person { public int Id { get; set; } public string Firstname { get; set; } public string Lastname { get; set; } public virtual List<Person> Friends { get; set; } } With the following EF Fluent API: modelBuilder.Entity<Person>() .HasMany(m => m.Friends) .WithMany() .Map(m => m.ToTable("Friends")); The database is generated successfully. The problem is when I perform a que ry with Breeze (client side) I have no data for the Friends property. var query = entityQuery.from('Person') .where('id

DurandalJS - Why are transitions not starting right away when a user navigates

允我心安 提交于 2019-12-05 16:16:03
Could someone explain why the transitions (at least the default one - entrance) are not starting right away when a user clicks on a link (navigate) with Durandal? In other words, do we need two mechanisms (loader animation + transition) to indicate that there is an action underway (ex. ajax call inside the activate method). I'm sure there's a good reason, or maybe I just have to modify the entrance transition? daedalus28 It seems like Durandal's transitions run once the activate function resolves. I asked a similar question where I enumerated some of the possible solutions that I found which

Using r.js to package a SPA application that loads views using 'text'

余生颓废 提交于 2019-12-05 16:05:07
问题 I'm attempting to build a SPA application (requirejs, durandal 2, knockout) into a single main-build.js file using grunt, and I'm running into serious issues with the 'text' plugin that durandal is using to load my views. In dev, I'm successfully using 'text' to load views dynamically as per the standard way of building durandal apps. The difference is that I need to do some server side templating for the views and so they are actually being dynamically generated. With that in mind I'd like

Chrome//kendoUI/jQuery: Maximum call stack size exceeded

时光怂恿深爱的人放手 提交于 2019-12-05 15:53:15
I am working hottowell template to create spa application and I am getting a nice error from jquery. Basically my problem start at the moment to try bind my view from viewModelBinder.js (from durandal library). viewModelBinder.beforeBind(obj, view); action(); viewModelBinder.afterBind(obj, view); at the moment to call beforeBind this code is executed (main.js of my own app) kendo.ns = "kendo-"; viewModelBinder.beforeBind = function (obj, view) { kendo.bind(view, obj.viewModel || obj); }; where kendo.bind is something like (kendo.web.js from kendo ui library): function bind(dom, object) { var

DurandalJS Routing Behavior

浪子不回头ぞ 提交于 2019-12-05 13:55:38
What I Have Trying to understand what's going on and how to control it. I have a "public" view for users that have not yet been authenticated, and a "home" view for users that are authenticated. Here's my route config: app.start().then(function() { //Replace 'viewmodels' in the moduleId with 'views' to locate the view. //Look for partial views in a 'views' folder in the root. viewLocator.useConvention(); //configure routing router.useConvention(); router.mapRoute('home', 'viewmodels/home', 'Test App', true); router.mapRoute('public', 'viewmodels/public', 'Test App', true); router.mapRoute('set

Breezejs EntityManager MetadataStore and fetchEntityByKey

徘徊边缘 提交于 2019-12-05 12:04:47
I have a SPA application (durandaljs), and I have a specific route where I map the "id" of the entity that I want to fetch. The template is "/#/todoDetail/:id". For example, "/#/todoDetail/232" or "/#/todoDetail/19". On the activate function of viewmodel, I get the route info so I can grab the id. Then I create a new instance of breezejs EntityManager to get the entity with the given id. The problem is when I call manager.fetchEntityByKey("Todos", id), the EntityManager doesn't have yet the metadata from the server, so it throwing exception "Unable to locate an 'Type' by the name: Todos". It

Durandal Custom View Location Strategy

送分小仙女□ 提交于 2019-12-05 08:24:41
I am trying to figure out how to use a custom view location strategy, I have read the documentation at this page http://durandaljs.com/documentation/Using-Composition/ but I don't exactly understand what the strategy function should look like. Can anybody give me a quick example of what the implementation of this function would be like and the promise that returns (even a simple one) etc? Thanks in advance, Gary p.s. This is the code in my html: <div> <div data-bind="compose: {model: 'viewmodels/childRouter/first/simpleModel', strategy: 'viewmodels/childRouter/first/myCustomViewStrategy'}"><

Create 2 way custom binding with observable plugin

断了今生、忘了曾经 提交于 2019-12-05 04:59:46
问题 The clues for this question seem so hard to find that I begin to think it must be either obvious (and I'm missing something), useless, or impossible: I get the 2-way binding thing in knockout with observables (ko.observables()). However all this parenthesis are a real pain. So as I'm using Durandal, I though I'd give the observable plugin a try : http://durandaljs.com/documentation/Binding-Plain-Javascript-Objects.html (for the record, I also tried this one: http://blog.stevensanderson.com

Mark fields not valid as red with knockout/durandal

亡梦爱人 提交于 2019-12-05 02:25:36
问题 I am learning knockout, Durandal and Breeze and thanks to the JumpStart SPA video from John Papa this is a pleasure. So I examine the code of this project and right now I am trying to change the validation mechanism. At this time, when saving changes, if the save failed, we collect the errors and display a toast with a resume of the errors. What I would like to achieve is: having the ability to mark fields not valid in red (background-color) in the view when a toast is displayed with the