0

I had working tab navigation and I upgraded my packages.

Now when trying to navigate to a tab the urls are getting garbled up.

If my url is: /#!/messages, and I click on the Contacts tab, instead of going to /#!/contacts, the url becomes: /#!/!/contacts.

<ion-tabs class="tabs-positive tabs-icon-top">
    <ion-tab title="Contacts" ui-sref="tab.contacts"></ion-tab>
    <ion-tab title="Messages" ui-sref="tab.messages"></ion-tab>
</ion-tabs>

I feel I've got a version problem with ionic and angular but I don't know where to start figuring this out.

Here's the basic routing (Typescript):

$stateProvider
    .state('tab', {
        abstract: true,
        templateUrl: "templates/includes/tab_bar.html"
    })
    .state('tab.contacts', {
        url: '/contacts',
        views: {
            'contacts': {
                templateUrl: 'templates/contacts.html',
                controller: 'ContactsController',
                controllerAs: '$ctrl'
            }
        }
    })
    .state('tab.messages', {
        url: '/messages',
        views: {
            'account': {
                templateUrl: 'templates/messages.html',
                controller: 'MessagesController',
                controllerAs: '$ctrl'
            }
        }
    })
$urlRouterProvider.otherwise(() => '/messages');

Tab navigation was working acceptably until I upgraded JavaScript modules up to the latest.

I'm sure somebody with nostalgia for the ancient version 1 has a memory of such problems?

I don't want to supplant this nice clean method with href or $state.go. The ui-sref seems like best practice. So I want resolve the problem, not hack a solution.

Thanks Much!

iJames
  • 640
  • 1
  • 7
  • 16
  • Additional Information: If I manually type in the urls correctly, I can navigate to the tabs. And then once I do that, clicking on the tabs works correctly? Totally unclear what's going on in the middle of ui-router here. Caching? – iJames Apr 15 '18 at 01:31
  • Any help? https://stackoverflow.com/questions/18214835/angularjs-how-to-enable-locationprovider-html5mode-with-deeplinking Maybe look at $location / switching between html5 and hashbang mode / link rewriting on there too. – Shaun Webb Apr 15 '18 at 10:54

0 Answers0