-
Notifications
You must be signed in to change notification settings - Fork 38
Open
Description
ampersand-view/ampersand-view.js
Lines 304 to 306 in beb1bdf
| return new subview.constructor({ | |
| parent: self | |
| }); |
The auto-generated prepareView function does not provide an el argument to the constructor. As a result, the returned view instance's el may be undefined, causing container.appendChild(view.el) in renderSubview to fail. Is this a bug, or am I using it in a wrong way?
ampersand-view/ampersand-view.js
Lines 221 to 230 in beb1bdf
| renderSubview: function (view, container) { | |
| if (typeof container === 'string') { | |
| container = this.query(container); | |
| } | |
| if (!container) container = this.el; | |
| this.registerSubview(view); | |
| view.render(); | |
| container.appendChild(view.el); | |
| return view; | |
| }, |
I found this issue when trying to use the example provided in ampersand-view's doc:
module.exports = AmpersandView.extend({
...
subviews: {
...
tab: {
hook: 'switcher',
constructor: ViewSwitcher
}
}
});Metadata
Metadata
Assignees
Labels
No labels