I'm just getting started with Ember. I went through the starter kit video and practice app.
Now I'm creating my own app. I can't for the life of me get it to render my about template. I keep getting "Uncaught Error: There is no route named about". Obviously, it doesn't think I have a router set up, but in the starter kit, they put in static text for their about section and were able to get it to show up without writing router extension code like:
App.AboutRoute = Ember.Route.extend({
//code would go here.
});
what am i missing? it's driving me crazy!
here's my index.html:
<!doctype html>
<html class="no-js" lang="en">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>PickUp</title>
<link rel="stylesheet" href="assets/css/compiled.css" />
</head>
<body>
<script type="text/x-handlebars">
{{#link-to 'index'}}asdf{{/link-to}}
<nav>
<li>{{#link-to 'about'}}About{{/link-to}}</li>
</nav>
{{outlet}}
</script>
<script type="text/x-handlebars" id="about">
text
</script>
<!-- dependencies -->
<script src="assets/js/libs/jquery-2.1.3.min.js"></script>
<script src="assets/js/libs/handlebars-2.0.0.min.js"></script>
<script src="assets/js/libs/ember-1.9.1.min.js"></script>
<script src="assets/js/app.min.js"></script>
</body>
</html>
and here's my app.js code:
App = Ember.Application.create();
App.Router.map(function(){
this.resource('about');
});
the rest of the code in the starter kit example relates to post and posts routes.
any help is much appreciated, thanks!
Aucun commentaire:
Enregistrer un commentaire