kappys
October 19, 2015, 9:55pm
1
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
kappys
October 22, 2015, 11:51am
3
Hi,
Thanks! this works now!
and now I have another question… can you help me?
Hi, I have a problem when I try change view on the ionic view app for IO’S ( I don’t prove the android app). I see that is a app bug and it have solution but this don’t work for me. info bug :...
Reading time: 1 mins 🕑
Likes: 1 ❤
thanks