Last active
December 30, 2015 23:39
-
-
Save rhettc/7902073 to your computer and use it in GitHub Desktop.
A look at controllers and templates
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
// Establishing routes | |
<script type="text/javascript"> | |
Notes.Router.map(function () { | |
this.resource('notes', {path: "/"}, function() { | |
this.route('note', {path: "/note/:note_id"}); | |
}); | |
}); | |
Notes.NotesRoute = Ember.Route.extend({ | |
// Note here where we are "setting the subject for the index action" | |
model: function() { | |
return this.store.find('note'); | |
} | |
}); | |
</script> | |
<div class="list-group" style="margin-top: 10px;"> | |
<!-- The controller reference points to the subject that was defined for the controller --> | |
{{#each controller}} | |
<div class="list-group-item"> | |
{{name}} | |
</div> | |
{{/each}} | |
</div> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment