Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Is it me or ... Confusing example at Backbone Basics / View / Understanding render(): #726

Open
TorbenTigges opened this issue Mar 10, 2017 · 2 comments

Comments

@TorbenTigges
Copy link

In the section Backbone Basics / Views / Understanding render(), some basic HTML is given with the words: "Our example will reference the following HTML markup:", but unfortunately, none of the then following examples seem to work with this HTML.

I was perfectly able to understand the examples in previous sections, thanks to copying the code and playing around with it. But these examples just don't give any feedback.

So, maybe it's just me, maybe I am to impatient to wait for the next 5 examples to be slowly put together to finally give me some feedback when playing around in the code myself, but to me this seems to be missing some sort of instant feedback to understand the mechanics.

(Also: The first example code introduces "template" and in the comment it says "// In this case '...' is a placeholder for a template such as $("#list_template").html()"
Imho it would make sense to use the code's actual template id here, #item-template, or switch the id in the HTML markup to #list_template, as used in the comment.)

Next, why does the 2nd example switch from "var ListView = Backbone.View.extend" to "var ItemView = Backbone.View.extend"? Are we supposed to replace the previous code (like the examples in the previous section of the book) or add this below the previous code?

The third example switches back to "var ListView = ..." but is missing anything about the template and also anything ressembling some sort of feedback (markup, console, ...). At this point I am copying code but I can't change it to understand the mechanics. I am sure it will be getting clear later on, if only I bite through this part with the obvious questionmarks remaining in my head, but some help at this point would be nice to keep the learning as smooth as in the (excellent) first parts of the book.

@joelkraft
Copy link

joelkraft commented Feb 28, 2018

There seems to be a code example missing around line 562. I'm also finding the author's points hard to follow here.

@joelkraft
Copy link

Ah.. I think the code for this is on line 392. If it is, I'm not sure I understand why it's so far from the explanation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants