SpineJS and RequireJS
Posted
by
ot3m3m
on Stack Overflow
See other posts from Stack Overflow
or by ot3m3m
Published on 2012-06-14T15:43:26Z
Indexed on
2012/06/15
15:16 UTC
Read the original article
Hit count: 294
I am using require.js 2.0.
I have the following code that is called initially by require: app.js
requirejs.config({
paths: {
app: '..',
spine: 'spine_src/spine',
cs: "cs",
},
shim: {
'spine_src/route': {
deps: ['spine']
}
}
});
// Start the main app logic.
requirejs(['cs!app/StartApp_Admin', 'spine','spine_src/route'],
function (StartApp_Admin, Spine, Route) {
{
new StartApp_Admin();
}
});
And the following controller: StartApp_Admin
define () ->
class StartApp_Admin extends Spine.Controller
constructor: ->
@routes
"/twitter/:id": (params) ->
console.log("/users/", params.id)
Spine.Route.setup()
When I execute the application I get the following error in my spine route library file (route.js
). The application breaks when I call Spine.Route.setup()
Uncaught TypeError: Object function (element) {return element;} has no method 'extend'
Any help would be greatly appreciated
© Stack Overflow or respective owner