What is the purpose of abstract?

From the ionic provided sample starter app, we will see something like this:

 $stateProvider

      // setup an abstract state for the tabs directive
        .state('tab', {
        url: '/tab',
        abstract: true,
        templateUrl: 'templates/tabs.html'
      })

What is the purpose of abstract? Comment it out, the thing still works…

this means that this state is not navigate able and acts like parent of child states. Take it like name spacing.

If you have abstract:true and you try to navigate to that state, it will throw an error. Make it false it will work.

tab is the parent state and tab.child1 is child state. You always refer to child and never to parent. It helps in organising the states.

2 Likes