Just started learning Ember, following a few examples, and the very basic stuff fails on me.
I'm getting Uncaught ReferenceError: DS is not defined
in Chrome.
I'm including Handlebars just before Ember.js
<html>
<head>
<title>Ember Test App</title>
<link rel="stylesheet" type="text/css" href="css/bootstrap.min.css" />
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.9.0/jquery.min.js"></script>
<script type="text/javascript" src="js/handlebars.js"></script>
<script type="text/javascript" src="js/ember.js"></script>
</head>
<body>
<div class="container">
<div class="row">
<div class="span8 offset2" id="app">
</div>
</div>
</div>
<script type="text/x-handlebars" data-template-name="application">
<h1>Ember App</h1>
{{outlet}}
</script>
<script type="text/javascript" src="app.js"></script>
</body>
</html>
window.App = Ember.Application.create({
rootElement: $("#app")
});
App.Store = DS.Store.extend({
revision: 11
});
Ensure that ember-data is included after ember itself:
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.9.0/jquery.min.js"></script>
<script type="text/javascript" src="js/handlebars.js"></script>
<script type="text/javascript" src="js/ember.js"></script>
<script type="text/javascript" src="js/ember-data.js"></script>
You need ember-data to use DS.Store. I have uploaded it here for one of my jsFiddles to work cause I couldnt find it anywhere else.
Note however that you do not need ember-data to use ember.
EDIT:
Had to delete the one I had uploaded so just get it from http://github.com/emberjs/data/downloads
You can grab ember-data by cloning the ember-data repo and running rake dist within the repo folder. This will push out the relevant release files under the dist folder.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With