Skip to content

Instantly share code, notes, and snippets.

@thecountofzero
Created July 26, 2013 16:38
Show Gist options
  • Save thecountofzero/6090327 to your computer and use it in GitHub Desktop.
Save thecountofzero/6090327 to your computer and use it in GitHub Desktop.
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Swallower</title>
<!--[if lt IE 9]>
<script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
</head>
<body>
<div id="dummy"></div>
<script type='text/javascript' src='../../steal/steal.js'></script>
<script type='text/javascript'>
steal('can/model', 'can/util/fixture', function(Model) {
$(document).ready(function() {
var Thing = Model({
findAll: {
url: 'GET /things',
cache: false
}
}, {});
var THINGS = [{
"id": "1",
"name": "Dave Winfield"
}, {
"id": "2",
"name": "Ken Griffey Jr."
}, {
"id": "3",
"name": "Frank Thomas"
}, {
"id": "4",
"name": "Ryan Braun"
}];
can.fixture('GET /things', function() { return THINGS; });
Thing.findAll().then(function(things) {
console.dirs(things);
});
});
});
</script>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment