For my Angular 1.x application, I needed a way to hide the header and footer on specific pages. To achieve this, I added a 'navigateOut' data property to my state definitions. Using ng-if in my template, I was able to show/hide elements such as the header and footer based on the value of this property. However, I encountered an issue where these elements would briefly appear when the page was loading because the state had not yet been set.
.state('signup', {
url: '/signup',
template: require('partials/sso.html'),
controller: 'SignupController as signup',
data: {
navigateOut: false
}
})
<app-footer ng-if="$state.current.data.navigateOut !== false"></app-footer>