Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trialChristian Kessinger
Full Stack JavaScript Techdegree Student 10,803 PointsEmber.js Bummer! You need to use 'each' within the <ul> element to output <li> elements with each kitten's name.
I'm going cross eyed from looking at this what am I missing?
AnimalShelter = Ember.Application.create();
AnimalShelter.Router.map(function() {
this.resource('kittens', {path: '/'});
});
var kittens = [
{id: '1', name: 'Meowzer'},
{id: '2', name: 'Squeaky'},
{id: '3', name: 'Fluffy'}
]
AnimalShelter.KittensRoute = Ember.Route.extend({
model: function() {
return kittens;
}
});
<!DOCTYPE html>
<html>
<head>
<title>Animal Shelter</title>
</head>
<body>
<script src="js/libs/jquery-1.10.2.js"></script>
<script src="js/libs/handlebars-v1.3.0.js"></script>
<script src="js/libs/ember-1.8.1.js"></script>
<script src="js/app.js"></script>
<script type="text/x-handlebars" id="kittens">
<h1>Kittens</h1>
<p>Here is a list of all of our kittens:</p>
<ul>
{{#each}}
<li>{{kittens}}</li>
{{/each}}
</ul>
</script>
</body>
</html>
2 Answers
Chase Marchione
155,055 PointsHi Christian,
Instead of kittens, you'll want to write in name. The each loop needs to cycle for each kitten, and you'll use the name key to accomplish that.
<ul>
{{#each}}
<li>{{name}}</li>
{{/each}}
</ul>
Hope this helps!
Christian Kessinger
Full Stack JavaScript Techdegree Student 10,803 Pointswow, thank you guess I've been looking at this for to long tonight.
It's always the simple things.