My Objective
- I am working with two different styles of display:
- "Normal": [ Header | Body | Footer ] - primarily used for most views
- "Discreet": [ Body ] only, centered on screen - ideal for states like login/register, errors etc.
- These display styles do not have specific URLs such as
example.com/normal/*
orexample.com/discreet/*
, but rather serve as templates for various views without affecting the URL. - When transitioning between 'normal' styled states, I want only the body to reload with animation while the header/footer remain static.
- In contrast, when switching between 'discreet' styled states, the entire page (comprising solely of the body view) should transition.
Desired State URLs and Screenshots:
Approaches Taken So Far
While the visual aspect is currently satisfactory, issues arise when handling transitions where the header/footer animate alongside the body:
Configuration in app
$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')