logicalparadox/backbone.iobind — Issue #12: Improved amd/requirejs support
Author: logicalparadox
Created: 2012-01-26 00:39:59+00:00
State: open
Labels: feature

What I ultimately want to get to is like this example from [backbone.modelbinding](https://github.com/derickbailey/backbone.modelbinding/blob/master/backbone.modelbinding.js#L534).

```js
if (typeof define === 'function' && define.amd) {
// AMD support
define([
'backbone', // use Backbone 0.5.3-optamd3 branch (https://github.com/jrburke/backbone/tree/optamd3)
'underscore', // AMD supported
'jquery' // AMD supported
], function (Backbone, _, jQuery) {
return modelbinding(Backbone, _, jQuery);
});
} else {
// No AMD, use Backbone namespace
root.Backbone = Backbone || {};
root.Backbone.ModelBinding = modelbinding(Backbone, _, jQuery);
}
```