Comments (5)
So if you create a view called 'SomeViewLabel' and then try create another view with the name 'SomeViewLabel' what will happen is that the first one you created will unbind any events attached to it before it overrides itself with the new one.
Does this make any sense?
from backboneboilerplate.
Ah OK , yes it makes sense, but what would be great is to be able to be at viewone and when you go to viewtwo to unbind the events or other stuff from viewone. Let's say my viewone has a var tick = setInterval() I want to be able to cleatInterval(tick) before I open the viewtwo.
from backboneboilerplate.
Hi thomas,
trying to understand why we would want to keep the views around and then remove them when we are about to create a new view with the same name? Wouldn't it make more sense to follow the path you outline in your tutorials (remove the currentView if there is one and then set the currentView to the new view being displayed) ?
Appreciate your feedback and thoughts.
from backboneboilerplate.
Shouldn't the "vm" be responsible for calling the "destroy"(unbind and remove view) method on each view that is about to be replaced?
Not sure if you want to have previous created views being "zombies" around your application.
from backboneboilerplate.
I agree with @chchrist. vm should also have a separate destroy logic(along with create), where a view can be explicitly destroyed by passing its name.
from backboneboilerplate.
Related Issues (20)
- problem with $.ajax call when overriding Backbone.sync in offline mode HOT 12
- Bootstrap? HOT 3
- Need more documentation and explanation of the View Manager
- I can't upgrade underscore & backbone HOT 1
- Use Lo-Dash instead of Underscore.js. HOT 4
- output visuals broken
- menu links '.active'
- Does not work with newest version of backbone.js(0.9.2) HOT 1
- Error... Module loading did not complete for HOT 1
- Small Request... HOT 1
- Typo in all views "intialize" instead of "initialize" HOT 1
- how to router.navigate ? HOT 2
- Using Lo-Dash v1.0.0
- View Transitions
- Upgrade to backbone 1.0?
- Minor layout bug
- All pages need padding-top: 4em on container
- Broken
- Can I use jQuery Mobile?
- Site Disabled
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from backboneboilerplate.