To get sammy to work I just drop the $.
notation since I'm injecting it
@router = sammy( ->
@get( '#/', ( data ) ->
self.sammypath( 1 )
)
)
I can't seem to get $.sammy
to work unfortunately. The RequireJs documentation has some hints as to how to get $.sammy
to work perhaps
var require = {
deps: ["some/module1", "my/module2", "a.js", "b.js"],
callback: function(module1, module2) {
//This function will be called when all the dependencies
//listed above in deps are loaded. Note that this
//function could be called before the page is loaded.
//This callback is optional.
}
};
It looks like I could use the callback to get this to work with something like this
var require = {
deps: ["jquery", "sammy"],
callback: ($, sammy) ->
$.sammy = sammy
}
But I can't get this to play with the require.config
, if someone knows how to sort this let me know! I've seen other people do something like this with knockout
and ko
and the mapping plugin ko.mapping