I'm using ui-roter. I have two groups of pages. Group A and Group B. In each group the header and footer are repeated but the content changes. How can I do not to repeat the header and footer in each group ?. Is there a way to make the code simpler? Try a variable but it did not work for me.
My index.html
<div ui-view="header"></div>
<div ui-view="content"></div>
<div ui-view="footer"></div>
Group A
$stateProvider
.state('inicio', {
url: '/inicio',
views: {
'header': {templateUrl: 'views/header.html'},
'content': {templateUrl: 'views/inicio.html'},
'footer': {templateUrl: 'views/footer.html'}
}
});
$stateProvider
.state('seguroPersonas', {
url: '/seguroPersonas',
views: {
'header': {templateUrl: 'views/header.html'},
'content': {templateUrl: 'views/seguroPersonas.html'},
'footer': {templateUrl: 'views/footer.html'}
}
});
$stateProvider
.state('seguroEmpresas', {
url: '/seguroEmpresas',
views: {
'header': {templateUrl: 'views/header.html'},
'content': {templateUrl: 'views/seguroEmpresas.html'},
'footer': {templateUrl: 'views/footer.html'}
}
});
Group B
$stateProvider
.state('dashboard', {
url: '/dashboard',
views: {
'header': {templateUrl: 'views/dashboard/headerDashboard.html'},
'content': {templateUrl: 'views/dashboard/inicioDashboard.html'},
'footer': {templateUrl: 'views/dashboard/footerDashboard.html'}
}
});
$stateProvider
.state('clientesPotenciales', {
url: '/dashboard/clientesPotenciales',
views: {
'header': {templateUrl: 'views/dashboard/headerDashboard.html'},
'content': {templateUrl: 'views/dashboard/clientesPotenciales.html'},
'footer': {templateUrl: 'views/dashboard/footerDashboard.html'}
}
});
$stateProvider
.state('seguroEmpresas', {
url: '/seguroEmpresas',
views: {
'header': {templateUrl: 'views/dashboard/headerDashboard.html'},
'content': {templateUrl: 'views/dashboard/actualizacionDatos.html'},
'footer': {templateUrl: 'views/dashboard/footerDashboard.html'}
}
});