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!