Monday, June 3, 2024
172
rated 0 times [  175] [ 3]  / answers: 1 / hits: 26843  / 11 Years ago, tue, april 23, 2013, 12:00:00

Why do the properties tagName, id and className exist in a Backbone View?


More From » model-view-controller

 Answers
3

Those properties are used if your view has to create its own element, that is, if it doesn't have a el attribute when instantiated (various reasons, I can go further in the matter). So you'll have a new element with the id id, classes className and attributes attributes.



You can find the relevant piece of code here. This _ensureElement method is used in the view's constructor.


[#78681] Monday, April 22, 2013, 11 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
margob

Total Points: 302
Total Questions: 89
Total Answers: 100

Location: Guadeloupe
Member since Sat, Jul 25, 2020
4 Years ago
margob questions
Mon, Jun 29, 20, 00:00, 4 Years ago
Wed, Sep 26, 18, 00:00, 6 Years ago
;