Nested multiples views inside ion-tabs

hi, I need nested multiples views inside ion-tabs because I want create a modular app, for example this:

inside recentQuestionsAnswers.html I create a ion-nav-view :
<ion-view view-title="Recent questions and answers"> <ion-content> <h1>Recent Questions</h1> daho <ion-nav-view name="prove"></ion-nav-view> </ion-content> </ion-view>

and in the app.js:

.state('app.questionsAnswers.recent', {
url: "/recent",
views: {
  'recent-questions': {
    templateUrl: "recentQuestionsAnswers.html",
    controller: 'recentQuestionsAnswersCtrl'
  },
  'prove': {
    templateUrl: "asd.html",
    controller: 'asdController'
  }
}

})

I need heelp!!

thanks

I would like to help but I need more details: What I understand is, you are trying to inject prove view in recent-questions.html it’s possible but not like this actually recent-question has to be an absctract view.

.state('app.questionsAnswers', {
    url: '/questionAnswers',
    abstract: true, // [https://github.com/angular-ui/ui-router/wiki/Nested-States-and-Nested-Views][1]
    views: {
        'recent-questions': {
            templateUrl: "recentQuestionsAnswers.html",
            controller: 'recentQuestionsAnswersCtrl'
        }    
    }
})
.state('app.questionsAnswers.recent', {
    url: '/recent',
    views: {
        'prove': {
            templateUrl: "asd.html",
            controller: 'asdController'
        }
    }
});

Now let’s talk about the html part:

<ion-view view-title="Recent questions and answers">
    <ion-content>
        <h1>Recent Questions</h1>
           daho
        <ion-nav-view name="prove"></ion-nav-view>
     </ion-content>
</ion-view>

so now to conclude, you’re state recent can contain many views ans those views can be declare in the html via the ion nav view.

good luck but I insist you have to read the doc about nested state here Nested State UI-Router

1 Like

Hi,

Thanks! this works now! :slight_smile:

and now I have another question… can you help me? :pensive:

thanks