Using view.rendered to determine whether or not to render a view might cause issues with views with bindings that have been rendered once before. There is a discussion on ampersand-view about this.
Some alternatives:
// very naive and hacky way to check if an element is in the DOM
document.contains(view.el);
// Maybe a little better
// When removing an element
view.remove();
delete view.el;
// Set our own property
view.remove();
view.removed = true;
This is a tough problem but I think we can find a solution.
Using
view.rendered
to determine whether or not to render a view might cause issues with views with bindings that have been rendered once before. There is a discussion on ampersand-view about this.Some alternatives:
This is a tough problem but I think we can find a solution.