I have two states. One state is a table with domains and the second state is information about a domain. The table has filters (dropdown selects, dropdown checkboxes) that can be applied to the table data. You can click into the domain from the table that triggers the second state (state1.domain).
My question is when I click away from state1 into state1.domain and then click back to state1 how can i preserve my filtered data and not reinitialize the controller? Currently, when I click back to state1 my filters have been cleared and so is the table data.
$stateProvider
.state ('state1', {
url: '/state1',
views: {
"main@": {
controller: 'StateOneCtrl',
templateUrl: 'folder/state1.tpl.html'
}
},
ncyBreadcrumb: { label: 'State One' },
data: { pageTitle: 'State One', showTitle: false}
})
.state('state1.domain', {
url: '/:domain',
views: {
"main@": {
controller: 'StateOneDomainCtrl',
templateUrl: 'folder/state1-domain.tpl.html'
}
},
ncyBreadcrumb: { label: '{{domain}}' },
data: { pageTitle: 'State One Domain', showTitle: false }
})