durandal

jquery mobile and Durandal

﹥>﹥吖頭↗ 提交于 2019-12-11 02:27:19
问题 Please anyone suggest me, it's good idea to use Durandal and JuqueryMobile for mobile based application (Browser). I am planning to develop an application using Durandal, Jquerymobile, MVC4, KnockoutJs, and BreezeJs. Thanks 回答1: I wouldn't recommend using jQuery mobile because it has a lot of overlapping features w/ durandal. Unless you want to just use jQuery mobile for the controls. I asked on the google group forums and ratchet was suggested instead. Not exactly the answer your looking for

containerless statements of knockoutjs is not working in hottowel SPA?

无人久伴 提交于 2019-12-10 23:48:50
问题 I was trying to use the containerless statements like <!--ko if:IsShowData==true --> of knockoutjs in hot towel template but it was not woring instead if i use visible binding with some element like div then it work very fine.( <div data-bind="visible: IsShowData==true"></div> ) Can anybody tell me if containerless statements of knockoutjs doesnt work in hot towel template? In Default Hot towel template i added few lines in home.html and home.js as follow: views/home.html <section> <h2 class=

Durandal KO Binding View Issue

南楼画角 提交于 2019-12-10 23:40:48
问题 I have Durandal viewmodel working like so: define(function (require) { var http = require('durandal/http'); return { subjectItem: function (data) { var self = this; self.Subject_ID = data.Subject_ID; self.Subject_Name = data.Subject_Name; }, subjects: ko.observableArray([]), activate: function () { var self = this; http.ajaxRequest("get", "/api/values/getsubjects") .done(function (allData) { var mappedSubjects = $.map(allData, function (list) { return new self.subjectItem(list); }); self

Loading jquery plugin result into Durandal view

谁说胖子不能爱 提交于 2019-12-10 18:08:25
问题 I am using the Durandal Starter Template for mvc4. I have set the following simple View: <section> <h2 data-bind="html: displayName"></h2> <h3 data-bind="html: posts"></h3> <button data-bind="click: getrss">Get Posts</button> <div id="rsstestid" ></div> </section> and ViewModel: define(function (require) { var http = require('durandal/http'), app = require('durandal/app'); return { displayName: 'This is my RssTest', posts: ko.observable(), activate: function () { return; }, getrss: function (

durandal : best way to pass data between ViewModels

假如想象 提交于 2019-12-10 17:15:52
问题 Durandal: What is the correct way to pass data (parameters) between Viewmodels if possible (without dealing with the backend ). let say i have 2 views overview and details i want that went the user klick on a list element from overview it takes the id of that element and pass it to details Viewmodel so that i can start working with that id. thank you for the help 回答1: Hint: you probably want the route-driven approach. The other one is for the sake of completeness. Viewmodel-driven approach In

Durandal/Knockout Template Binding Not Inserting

狂风中的少年 提交于 2019-12-10 15:44:51
问题 I am currently trying to propagate a table row <tr> template into a <tbody> tag. Here is an example: HTML: <table> <tbody data-bind="template: { name : 'tableTemplate', foreach : tableRow }"> </tbody> </table> <script type="text/html" id="tableTemplate"> <tr> <!-- First Name --> <td data-bind="text: firstName"></td> <!-- Last Name --> <td data-bind="text: lastName"></td> </tr> </script> DurandalJS: define(function(require) { var self = this; self.app = require('durandal/app'); return {

Is there a way to access “exports” object in TypeScript modules?

佐手、 提交于 2019-12-10 14:32:06
问题 I am trying to use durandal and I need to getModuleId by passing the current module. My problem is that as I am using TypeScript, the underlaying object which is returned from AMD module seems not to be accessible by Typescript code: export function checkModule(){ var a = system.getModuleId(??); } the compiled TS will be converted into this: function checkModule(){ var a = system.getModule(??); } exports.checkModule = checkModule; instead of ?? I need to pass exports object which is defined

Pass a viewmode edit/add to the durandaljs wizard

扶醉桌前 提交于 2019-12-10 12:01:18
问题 https://github.com/dFiddle/dFiddle-2.0/blob/gh-pages/app/masterDetail/wizard/index.js When I look at this wizard I ask myself how can I pass a variable - like the mode being in an edit or add-mode for the wizard - to the index.js which creates step1, step2 and step3. I do not see where I could pass this data because the index.js which is the main-wizard holding all steps is created by durandal dynamically. So how can I pass data to the index.js so that I can decide wether I run the service

Front end javascript testing using Require and Resharper

隐身守侯 提交于 2019-12-10 11:39:38
问题 So I've been trying to figure out how front end testing works (unit testing) but I am getting stuck on some point. So I have my jasmine test set up as follows: describe('Blabla', function () { it('returns true', function () { var people = require(["people"], function(ppl) { return ppl; }); expect(people.getTitle()).toBe('People piolmjage'); }); }); But running this gets me: TypeError: undefined is not a funtion So obviously, people is undefined. So perhaps my callback comes in too late. But

Durandal Widget with multiple views

家住魔仙堡 提交于 2019-12-10 10:20:00
问题 I am working on a SPA using Durandal, and I have created a widget for displaying a particular page component. Following the Durandal Documentation, the widget is in app/widgets/my-widget and is composed of viewmodel.js and view.html . Now, I want to add a different view to the same widget - in effect, to have a "Basic" view and an "Advanced" view, with a flag in the ViewModel for which one will be used. I do not want to create two different widgets, because the ViewModel is exactly the same