What I'm trying to do
- There are two 'styles' or 'classes' of display
- "Normal": [ Header | Body | Footer ] - I use this for most states
- "Discreet": [ Body ] only, centre of screen - I use this for states like login/register, errors etc.
- These 'styles of display' don't correspond to
example.com/normal/*orexample.com/discreet/*, but are rather just extendable templates for other views. They should affect the URL at all. - When switching between
normalstyled states, only thebodyshould reload (animate, whatever) and the header/footer should remain static. - When switching between
discreetstyled states, the entire page, being wholely made of thebodyview, should transition.
Such that the URLs and states should look like this (screenshots):
What I've tried
What I've got visually works, until I start working with transitions, and you see the header/footer animate along with the body:
app.config()
$stateProvider
.state('index', {
url: '/',
views: {
'': { templateUrl: 'partials/template-normal' },
'body@index': { templateUrl: 'partials/view-index' }
}
})
.state('signin', {
url: '/signin',
views: {
'': { templateUrl: 'partials/template-discreet' },
'body@signin': { templateUrl: 'partials/view-signin', controller: 'SigninCtrl' }
}
}
template-normal
header.app__header ...
main.app__body(ui-view='body')
footer.app__footer ...
template-discreet
main.app__body--discreet(ui-view='body')