One of the main reasons to use ui-view is listed as having multiple views:
main page
- header
- content
- footer
*other page*
- header
- content
- footer
However, views appear to be tied to states. If I have a header
state, I cannot include it in a list detail
state with <div ui-view='header'>
because header is not a view in list detail
.
I am not interested in a hacky answer, as this appears to be the major benefit of ui-router (eg http://www.funnyant.com/angularjs-ui-router/). If I can't get this to work in a clean way, I will go back to the default angular router.
What I have tried
I thought that possibly I would need to access a view in another state to make this work, but google is returning nothing for this.
This solution requires a seperate layout state and that every state be prefixed with root, which seems clunky. If this is an advertised selling point is there no better way to do this?
Multiple Named Views docs relies on all the views being defined for that specific state.
This similar question is answered with "use ng-include".
Another question on how to create a layout state is the closest to what I want, but requires a hacky root scope and that each child scope redefine a container@ view.