# Ionic v1 tabs history

**URL:** <https://forum.ionicframework.com/t/ionic-v1-tabs-history/106150>\
**Category:** ionic-v1\
**Created:** [September 20, 2017, 8:28pm UTC](https://forum.ionicframework.com/t/ionic-v1-tabs-history/106150 "2017-09-20T20:28:29Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![nogstudio](https://avatars.discourse-cdn.com/v4/letter/n/bbe5ce/32.png) [@nogstudio](https://forum.ionicframework.com/u/nogstudio)\
**Post date:** [September 20, 2017, 8:28pm UTC](https://forum.ionicframework.com/t/ionic-v1-tabs-history/106150/1 "2017-09-20T20:28:29Z")

</div>

Hi. I’m developing my first app with Ionic v1 and now I have a little problem. Let me explain.  
I have 3 tabs home,tab2,tab3.  
On home tab I have 1 deeplink which is normally from the tab2 content and when I click on the link it goes to /tab2/deeplink. Here comes the problem, because after I click on the tab2 the history is the content from /tab2/deeplink/ not the content from /tab2.  
Also if I go from home \> /tab2/deeplink and after that on tab1 \> tab2 it shows the content from /tab2/deeplink/ and if I click back it goes to /tab1/

Normal should be:  
Home \> /tab2/deeplink → clicking back should go to Home  
Tab2 \> The content \> /tab2/deeplink → clicking back should go to Home.  
Hope you understand! Thank you!

> .state(‘tabs.home’, {  
> url: ‘/home’,  
> views: {  
> ‘home-tab’: {  
> templateUrl: ‘templates/tab-home.html’,  
> controller: ‘HomeCtrl’  
> }  
> }  
> })  
> .state(‘tabs.articles’, {  
> url: ‘/articles’,  
> views: {  
> ‘articles-tab’: {  
> templateUrl: ‘templates/tab-articles.html’,  
> controller: ‘ArticlesCtrl’  
> }  
> }  
> })  
> //Read Article Page  
> .state(‘tabs.read’, {  
> url: ‘/read/:articleUrl’,  
> views: {  
> ‘articles-tab’: {  
> templateUrl: ‘templates/read-article.html’,  
> controller: ‘ReadCtrl’  
> }  
> }  
> })

From Home I’m going to tabs.read. From tabs.articles I can also go to tabs.read!

---

<div class="post-metadata">

**Author:** ![thesourav](https://avatars.discourse-cdn.com/v4/letter/t/a6a055/32.png) [@thesourav](https://forum.ionicframework.com/u/thesourav)\
**Post date:** [September 21, 2017, 4:18am UTC](https://forum.ionicframework.com/t/ionic-v1-tabs-history/106150/2 "2017-09-21T04:18:41Z")

</div>

on clicking of deeplink from home, you have to use `$state.go('tabs.read')`. This should go back to home on back click.  
Otherwise, If you want to get back to home from the deeplink page at all times, you have to override the backbutton action to go to the home view on the controller of the deeplink page.

> <https://stackoverflow.com/questions/32231737/ionic-override-all-back-button-behaviour-for-specific-controller>

Secondly, to remove history, you have to disable cache for that view  
Disable cache within state provider

```auto
$stateProvider.state('tabs.read', {
   cache: false,
   url : '/myUrl',
   templateUrl : 'my-template.html'
})

```

or, Disable cache with an attribute

```auto
<ion-view cache-view="false" view-title="My Title!">
  ...
</ion-view>

```

---

<div class="post-metadata">

**Author:** ![nogstudio](https://avatars.discourse-cdn.com/v4/letter/n/bbe5ce/32.png) [@nogstudio](https://forum.ionicframework.com/u/nogstudio)\
**Post date:** [September 22, 2017, 5:10pm UTC](https://forum.ionicframework.com/t/ionic-v1-tabs-history/106150/3 "2017-09-22T17:10:56Z")

</div>

Thank you! I’ve tried this solution and it works If I go to tab.readarticles but I need to go dipper like /tab/read/articleId and with $state.go I can’t make it work.  
The same /tab/read/articleId links are inside tab.readarticles.  
Edit:  
deeplinking solved with $state.go(“tabs.read”, { articleUrl: a });  
but if I click on the bottom tab it still goes to the article I clicked from the first page. Its not showing the list with articles!

---

<div class="post-metadata">

**Author:** ![thesourav](https://avatars.discourse-cdn.com/v4/letter/t/a6a055/32.png) [@thesourav](https://forum.ionicframework.com/u/thesourav)\
**Post date:** [September 22, 2017, 5:29pm UTC](https://forum.ionicframework.com/t/ionic-v1-tabs-history/106150/4 "2017-09-22T17:29:34Z")

</div>

> [@nogstudio](#):
>
> but if I click on

What is the name of the bottom tab and which page it should supposed to go to

---

<div class="post-metadata">

**Author:** ![nogstudio](https://avatars.discourse-cdn.com/v4/letter/n/bbe5ce/32.png) [@nogstudio](https://forum.ionicframework.com/u/nogstudio)\
**Post date:** [September 22, 2017, 6:30pm UTC](https://forum.ionicframework.com/t/ionic-v1-tabs-history/106150/5 "2017-09-22T18:30:05Z")

</div>

From home should go to

> //Read Article Page  
> .state(‘tabs.read’, {  
> url: ‘/read/:articleUrl’,  
> views: {  
> ‘articles-tab’: {  
> templateUrl: ‘templates/read-article.html’,  
> controller: ‘ReadCtrl’  
> }  
> }

```
})

```

When I’m on tabs.read from Home my Articles Tab is selected. Also from Articles Tab I can go to tabs.read

> //Articles Page  
> .state(‘tabs.articles’, {  
> url: ‘/articles’,  
> views: {  
> ‘articles-tab’: {  
> templateUrl: ‘templates/tab-articles.html’,  
> controller: ‘ArticlesCtrl’  
> }  
> }  
> })
