Created
February 26, 2013 05:17
-
-
Save matkl/5036103 to your computer and use it in GitHub Desktop.
A requirejs template using socket.io and knockout.js
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
requirejs.config({ | |
paths: { | |
'socket.io': '/socket.io/socket.io', | |
'knockout': 'http://cdnjs.cloudflare.com/ajax/libs/knockout/2.2.0/knockout-min' | |
}, | |
shim: { | |
'socket.io': { | |
exports: 'io' | |
} | |
} | |
}); | |
require(['socket.io', 'knockout', 'viewmodel', 'domReady!', function(io, ko, vm) { | |
ko.applyBindings(vm); | |
}]); |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<script data-main='/javascripts/app' src='/javascripts/require.js'></script> | |
</head> | |
<body> | |
Hello world. | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment