hottowel

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

Breeze.js - getting error trying to use “any” operator - error: Unable to get value of the property 'isAnonymous': object is null or undefined

北城以北 提交于 2019-12-07 18:23:36
问题 I am trying to use the "any" operator in Breeze to query a many table and I am getting the following error - TypeError: Unable to get value of the property 'isAnonymous': object is null or undefined The only stackoverflow question I can find that seems related is this one, but there is no solution to the isAnonymous issue because the poster did not provide more code: breeze projection : error selecting non scalar navigation properties I am using Breeze 1.4.11 with Entity Framework 5 The query

link to another controller with hot towel and durandal

*爱你&永不变心* 提交于 2019-12-07 12:10:52
问题 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

HotTowel Durandal Inject different views based on the user

依然范特西╮ 提交于 2019-12-07 12:01:23
In the shell.html for HotTowel template we have: <!--ko compose: {model: router.activeItem, afterCompose: router.afterCompose, transition: 'entrance'} --> <!--/ko--> which will automatically insert the proper view by convention. I am trying to inject different views based on the user's role in a HotTowel/Durandal App. For example, I have two Views, productEditor_Admin.html productEditor_Superviser.html (instead of these two views, I used to have only productEditor.html, by convention everything worked) and only a single ViewModel: productEditor.js Now, I want to have a function in

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

笑着哭i 提交于 2019-12-07 11:14:39
问题 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); };

Ui-Router 404 when redirecting with ADAL

我与影子孤独终老i 提交于 2019-12-07 06:12:18
问题 I'm currently trying to hook in the Azure Directory Authentication Library (ADAL.JS) into UI-Router. I've got it wired in, and it redirects correctly, but it always chucks a 404 before the redirect. The redirect works, and then gets sent back to my application, which is showing the 404. I've modified the state like so: { state: 'admin', config: { url: '/admin', templateUrl: 'app/admin/admin.html', controller: 'AdminController', controllerAs: 'vm', title: 'Admin', settings: { nav: 2, content:

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

Breeze.js - getting error trying to use “any” operator - error: Unable to get value of the property 'isAnonymous': object is null or undefined

扶醉桌前 提交于 2019-12-06 10:29:32
I am trying to use the "any" operator in Breeze to query a many table and I am getting the following error - TypeError: Unable to get value of the property 'isAnonymous': object is null or undefined The only stackoverflow question I can find that seems related is this one, but there is no solution to the isAnonymous issue because the poster did not provide more code: breeze projection : error selecting non scalar navigation properties I am using Breeze 1.4.11 with Entity Framework 5 The query I am trying to run is var getEntities = function (entitiesObservable) { var whereClause = "";

Durandal: Multiple Routes, One ViewModel/View

不打扰是莪最后的温柔 提交于 2019-12-06 07:32:37
I have 3 routes: items/one, items/two, and items/three and they're all pointing to 'items' vm/view. in the items.js activate function, I'm checking the url, and based on that, I'm changing a filter: function activate(r) { switch (r.routeInfo.url) { case 'items/one': vm.filterType(1); break; case 'items/two': vm.filterType(2); break; case 'items/three': vm.filterType(3); break; } return init(); //returns a promise } The items view has a menu with buttons for one, two, and three. Each button is linked to an action like this: function clickOne() { router.navigateTo('#/items/one'); } function

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