Skip to content

Instantly share code, notes, and snippets.

@commadelimited
Last active August 29, 2015 14:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save commadelimited/108d9cb8cb3a0e898957 to your computer and use it in GitHub Desktop.
Save commadelimited/108d9cb8cb3a0e898957 to your computer and use it in GitHub Desktop.
Application template outlet doesn't populate

With these two files in place (all dependencies met) I load the page at http://127.0.0.1:8000/ and get only the h1 (which is outside of the template). There are no errors, just emptiness. if I uncomment the renderTemplate method the content loads. On a side note, my models are not populating but I'm getting there.

My debug block:

DEBUG: Ember                          : 1.5.1 core.js:6268
DEBUG: Ember Data                     : 1.0.0-beta.8.2a68c63a core.js:6268
DEBUG: Handlebars                     : 1.3.0 core.js:6268
DEBUG: jQuery                         : 2.0.3 core.js:6268
DEBUG: ember-data-django-rest-adapter : 1.0.3 
var App = Ember.Application.create();
App.ApplicationAdapter = DS.RESTAdapter.extend({
namespace: 'api'
});
App.Router.map(function() {
this.route("index", { path: "/" });
});
App.IndexRoute = Ember.Route.extend({
model: function() {
return this.store.find('type');
},
//renderTemplate: function() {
// this.render({ outlet: 'application' });
//}
});
App.Type = DS.Model.extend({
name: DS.attr('string'),
description: DS.attr('string'),
});
<script type="text/x-handlebars" data-template-name="application">
{{outlet application}}
</script>
<script type="text/x-handlebars" data-template-name="index">
{{controller}}
{{#each type in controller}}
{{name}}<br />
{{/each}}
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment