Quantcast
Channel: Ionic Forum - Latest topics
Viewing all articles
Browse latest Browse all 70612

Using multiple views inside single state

$
0
0

@vvavepacket wrote:

Hi All, I'm trying to work on multiples views inside a single state. Basically, when the state 'home' loads, I want to load the 2 named views but it's not working. I've followed the rules on this and this.

Here is my index.html / main page

    <body ng-app="starter">
    <ion-pane>


    <ion-nav-view name="a1">
    </ion-nav-view>
    <ion-nav-view name="a2">
    </ion-nav-view>

    </ion-pane>
    </body>

Here is my app.js

var app = angular.module('starter', ['ionic']);

app.config(function($stateProvider,$urlRouterProvider) {
$stateProvider
.state('home', {
url: '/home',
views: {
'': { templateUrl: 'templates/default.html' },
'a1@home' : { templateUrl: 'templates/1.html' },
'a2@home' : { templateUrl: 'templates/2.html' }
}
})
$urlRouterProvider.otherwise('/home');
})

As you can see, when the 'home' is triggered, it should supply the contents of a1 and a2 to their respective ion-nav-view, but it's not happening. Nothing is displayed on the screen. Where it did go wrong? Thank you.

Posts: 1

Participants: 1

Read full topic


Viewing all articles
Browse latest Browse all 70612

Trending Articles