Created
July 26, 2013 16:38
-
-
Save thecountofzero/6090327 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
<!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