Skip to content

Instantly share code, notes, and snippets.

@JackEllis
Created November 26, 2014 05:26
Show Gist options
  • Save JackEllis/0a5a6e02a0d3a0f94891 to your computer and use it in GitHub Desktop.
Save JackEllis/0a5a6e02a0d3a0f94891 to your computer and use it in GitHub Desktop.
Anonymous Gistbook
{"title":"Anonymous Gistbook","author":"JackEllis","pages":[{"pageName":"","sections":[{"type":"text","source":"Issue with router"},{"type":"javascript","source":"// This works, notice that I return the foodRoute with .render()\nfood: function () {\n var that = this;\n this._prepareTrackingSection().done(function() {\n // The food route\n that.foodRoute = new FoodRoute({\n container: that.layout.main\n });\n\n that.foodRoute.setCollection();\n\n return that.foodRoute.render();\n });\n },"},{"type":"javascript","source":"// This does not render the route... Doesn't call .render() on the route.\n// But it worked fine when it wasn't inside a promise. When I simply had return that.foodRoute\n// (outside the callback of done(), it worked fine)\nfood: function () {\n var that = this;\n this._prepareTrackingSection().done(function() {\n // The food route\n that.foodRoute = new FoodRoute({\n container: that.layout.main\n });\n\n that.foodRoute.setCollection();\n\n return that.foodRoute;\n });\n },"}]}],"public":true}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment