I'm using both of the Ionic framework and IU router to make a better navigation for you my first web application.
Here a simple architecture so you can easily understand the structure :
The problem I'm facing is that i'm not able to keep the state when navigating between tabs. for example. when I go to the next tab and click on next view and Press return, then I navigate to the first button, and when I go back to the second tab, I don't see the same state I left.
I can't resolve this problem.
here is a DEMO : PLUNKER DEMO + CODE
and this is my states code :
.config(function($stateProvider, $urlRouterProvider) {
$stateProvider
.state('live.today', {
url: '/today',
views: {
today: {
templateUrl: 'today_live.html',
}
}
})
.state('live.yesterday', {
url: '/yesterday',
views: {
yesterday: {
templateUrl: 'yesterday_live.html'
}
}
})
.state('live.tomorrow', {
url: '/tomorrow',
views: {
tomorrow: {
templateUrl: 'tomorrow_live.html'
}
}
})
.state('match.composition', {
url: '/composition',
views: {
view: {
templateUrl: 'composition.html'
}
}
})
.state('match.resume', {
cache: false,
url: '/resume',
views: {
view: {
templateUrl: 'resume.html'
}
}
})
.state('live', {
url: '/live',
views: {
live_view: {
templateUrl: 'live.html'
}
}
})
.state('match', {
cache: false,
url: '/match_details',
views: {
live_view: {
templateUrl: 'match_details.html'
}
}
})
.state('news', {
cache: false,
url: '/news',
views: {
news: {
templateUrl: 'news.html'
}
}
})
$urlRouterProvider.otherwise('/live/today');
})
Finally I've found a solution, which is to add " <ion-content> </ion-content>
to the file where I have three tabs (live.html).
You can take a loot at the updated demo for someone who have the same complicated views architecture