Skip to content
Maxime LUCE edited this page Feb 26, 2014 · 1 revision

Introduction

KORM have to be used with an AMD library like require.js. We think that AMD Loading is a necessary thing in modern javascript application developpement, that's why we are providing KORM as an AMD optimized library.

We are thinking at providing a built version in next releases.

Configure require.js or almond

// app/main.js
require.config({
    paths: {
        knockout: 'path/to/knockout',
        underscore: 'path/to/underscore',
        jquery: 'path/to/jquery',
        koutils: 'path/to/koutils',
        korm: 'path/to/korm'
    }
});

Use any modules in your view models

// app/datacontext.js
define(["korm/datacontext"], function(context) {
    var ctx = new context.DataContext();
    ctx.addSet("Customers", "CustomerId", "Models.Customer");
    //...

    return context;
});

Clone this wiki locally