0

I try to make this Plunker to work, spent more then 5 hours, posting here was a last resort.

app.js

app.config(function($stateProvider, $urlRouterProvider) {

  $stateProvider
          .state('tab', {
      url: "/tab",
      abstract: true,
      templateUrl: "tabs.html"
    })

    // the pet tab has its own child nav-view and history
    .state('tab.pet-index', {
      url: '/pets',
      views: {
        'pets-tab': {
          templateUrl: 'pet-index.html',
          controller: 'PetIndexCtrl'
        }
      }
    })

    .state('tab.pet-detail', {
      url: '/pet/:petId',
      views: {
        'pets-tab': {
          templateUrl: 'pet-detail.html',
          controller: 'PetDetailCtrl'
        }
      }
    });

console.log('app load ...');

  // if none of the above states are matched, use this as the fallback
  $urlRouterProvider.otherwise('/tab/pets');

});

Here I call $urlRouterProvider.otherwise('/tab/pets')

But I fail to get controller:

app.controller('PetIndexCtrl', function($scope, PetService) {
  console.log('PetIndexCtrl load ...');
  $scope.pets = PetService.all();
});

What I do wrong here? please help,

Thanks,

0

1 Answer 1

1

It seems to come down to the ion- prefix missing in several places.

When I change nav-view to ion-nav-view, tabs to ion-tabs etc, things seems to work.

plunkr

Sign up to request clarification or add additional context in comments.

1 Comment

thank you mate, you saved me time, didn't think about

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.