Last active
December 29, 2015 14:09
-
-
Save nnnnathann/7682415 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//main.js | |
require.config({ | |
paths: { | |
jquery: 'components/jquery', | |
underscore: 'components/underscore', | |
backbone: 'components/backbone' | |
}, | |
shim: { | |
jquery: { exports: '$' }, | |
underscore: { exports: '_' }, | |
backbone: { deps: ['jquery','underscore'], exports: 'Backbone' } | |
} | |
}); | |
require(["app/test"], function(test) { | |
test.initialize(); | |
}); | |
//test.js | |
define(function(require){ | |
var _ = require('underscore'), | |
Backbone = require('backbone'), | |
$ = require('jquery'), | |
Auth; | |
var initialize = function(){ | |
Auth.Model = Backbone.Model.extend({ | |
idAttribute: 'personId' | |
}); | |
Auth.Collection = Backbone.Collection.extend({ | |
model: Auth.Model, | |
url:"/api/auth/" | |
}); | |
var bob = new Auth.Collection(); | |
bob.fetch(); | |
} | |
return { | |
initialize: initialize | |
}; | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment