durandal

inserting dynamic html into durandal views

╄→尐↘猪︶ㄣ 提交于 2020-01-15 10:43:17
问题 I am dynamically inserting html in durandal views but it does'nt work can any one help me out in that? my sample html is in durandal view <div data-bind="foreach:arrayofmodels"> <div data-bind="html:dynamichtml"/> </div> in my model(not view model) which is going to insert dynamic html dynamichtml(<span data-bind="click:Mymodelclickfunction"/>); in my viewmodel var arrayofmodels=ko.observableArray(); vm={ arrayofmodels:arrayofmodels; } return vm; there is a separate function to get list of

Using AMD module as an Aurelia ViewModel

孤者浪人 提交于 2020-01-15 07:27:10
问题 I was playing with Aurelia and seems pretty nice, I use Durandal for some projects and this definitively suit my needs. Use the new class definition from EC6 is awesome. But now I'm preparing something in which I need to use a classic AMD modules with requireJs, something like this one: define("testModule", [], function() { "use strict"; console.log('testModule loaded'); var testModule = function() { var that = this; this.variable = 10; that.getVariable = function(){ alert('function executed

1 viewmodel multiple routes: lifecycle

て烟熏妆下的殇ゞ 提交于 2020-01-11 10:15:13
问题 I'd like to have a couple of different routes pointing to the same view/viewmodel and I have managed to make this happen. { route: 'formulation', moduleId: 'formulation', title: 'Formulation', nav: 6 }, { route: 'fabrication', moduleId: 'test', title: 'Fabrication', nav: 7 }, { route: 'fabrication/:studyId', moduleId: 'test', title: 'Fabrication' }, { route: 'characterization', moduleId: 'test', title: 'Characterization', nav: 8 }, However, I'm running into a bit of a problem with the

Durandal JS and Google Plus Sign in Javascript API

廉价感情. 提交于 2020-01-06 12:56:39
问题 So I'm trying to build a mobile app using Durandal. However, I am having trouble to do so with Google plus JS API integration. I think here is the problem: The javascript client for gapi comes with asynchronous loading, so durandal initialization will crash having gapi undefined and because of this, the css components also do not render properly also. I have tried putting the following script tags in the login.html file of my view for login.js or even in the require.js section of my main.js

Durandal JS and Google Plus Sign in Javascript API

為{幸葍}努か 提交于 2020-01-06 12:55:49
问题 So I'm trying to build a mobile app using Durandal. However, I am having trouble to do so with Google plus JS API integration. I think here is the problem: The javascript client for gapi comes with asynchronous loading, so durandal initialization will crash having gapi undefined and because of this, the css components also do not render properly also. I have tried putting the following script tags in the login.html file of my view for login.js or even in the require.js section of my main.js

What am I doing wrong here returning viewmodel?

冷暖自知 提交于 2020-01-06 08:26:09
问题 I am trying to convert this to durandal/hottowel. viewModel: define(['plugins/router', 'knockout', 'services/logger', 'durandal/app', 'mapping', 'services/routeconfig', 'services/dataBindingHandlers', 'services/appsecurity'], function (router, ko, logger, app, mapping, routeconfig, dataBindingHandlers, appsecurity) { function activate() { logger.log(viewModel.title + "'s View Activated", null, viewModel.title, true); return true; } var viewModel = { activate: active, title: 'Overview', query:

Creating a autocomplete field with Typeahead in the Durandal Framework

送分小仙女□ 提交于 2020-01-05 07:57:34
问题 I'm trying to achieve a autocomplete input field with typeahead (twitter bootstrap). This autocomplete field should be in a modal but I cant seem to get it working! It also must be observable with knockout because when you select a value other fields should be updated to. So I'm kinda looking to do this in a modal! HTML <div class="messageBox"> <div class="modal-header"> <h2>Adding a repairline</h2> </div> <div class="modal-body" style="width: 35em;"> <form data-bind="submit: ok"> <fieldset>

Avoiding form resubmission in SPA (without P-R-G)

给你一囗甜甜゛ 提交于 2020-01-05 07:28:09
问题 I have a Single Page Application (SPA) built with DurandalJS v1.2 that integrates with a payment gateway. The SPA will go off to the payment gateway's page by doing a normal form POST to their page. Once the user has finished on the payment gateways page, the payment gateway will then do a form POST back to my SPA. Since it's a POST, I handle it server side in ASP.NET MVC by rendering out a require.js module definition for the various form parameters being sent, and this module is then used

Durandal Modal Won't Close

前提是你 提交于 2020-01-04 06:36:26
问题 Modals are turning out to be more difficult than I thought :/ Got the modal loading up a view / view modal properly, clicking the save button saves the information (I do get a 'Should be Empty : []' from Q.js but apparently this isn't a problem?) the problem I am having is probably related to promises but if it is I can't find it. Parent's view model - var createNew = function () { app.showModal(tfcreate).then(function (modalResult) { if (!modalResult) { return false; } var templateId =

Handling load timeouts of a view in a Durandal app

五迷三道 提交于 2020-01-04 03:30:12
问题 I've got a Durandal app that will periodically timeout when attempting to load a view. Here's an example timeout error: Error: Load timeout for modules: text!views/primaryapplicants.html http://requirejs.org/docs/errors.html#timeout If you lookup the provided URL, it suggests a few possible issues: Script error in listed module Path configuration incorrect Multiple module IDs map to the same file None of these are my issue. It is a real, genuine timeout. For some reason it wasn't able to load