Closed mikkoh closed 8 years ago
It might be better to do it so sub sections can create their own sub frameworks. A gallery is a good example. It could look something like:
var galleryFrameWork = framework.sub( '/gallery' , function( done ) {
done( {
routes: {
'/:galleryId': someSection // would match "#!/gallery/10"
}
});
});
It would also be good to think of passing the framework that caused the section to come in to be passed in the init function.
But also all frameworks should have ref to their parent:
galleryFrameWork.parent == framework // true
Currently one route is tied so heavily to one section it causes issues.
For instance:
If you went to the route
'/gallery/1'
thegallerySection
would never resolve.A better way to do it might be to do the following:
This would allow the framework to know that it needs to continue resolving routes potentially for a section.