Created
November 26, 2014 05:26
-
-
Save JackEllis/0a5a6e02a0d3a0f94891 to your computer and use it in GitHub Desktop.
Anonymous Gistbook
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
{"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