Best route for migrating a knockout based SPA to Durandal

28 views
Skip to first unread message

rob rhyne

unread,
May 11, 2015, 3:44:17 PM5/11/15
to duran...@googlegroups.com

Hi,

I have a large knockout / nodejs based application I'm trying to port to Durandal. View models are stored in separate files following my user.js file's convention:

var UserVm = function (mainVm) {

    var clsr = this;
    clsr.roles = ko.observableArray();
    ...
    return clsr;

}


I have the sample app up and running with some routes and jquery functioning perfectly, but I'm stuck at how to import about 100 of these view models into their respective durandal models. I tried including user.js in main.js:

requirejs.config({
    paths: {
        'text': '../lib/require/text',
        'user':'../path/to/user'
...


Then requring user when defining the module, but this caused an error in the console each time. 

define(['plugins/http', 'durandal/app', 'knockout', 'user'], function (http, app, ko) {

Any help would be appreciated!
Reply all
Reply to author
Forward
0 new messages