Definition of Routes IonicFramework

0

I use tabs to display the contents of an HTML.

<ion-view>
<ion-nav-title align="left">{{cliente}}</ion-nav-title>
<ion-content>

    <ion-tabs class="tabs-striped tabs-color-balanced">
        <ion-tab title="dados">
            <ion-nav-view name="tab-dados"></ion-nav-view>
        </ion-tab>
    </ion-tabs>

</ion-content>

Config

 $stateProvider
    .state('Clientes', {
        url: '/clientes',
        views: {
            'conteudo': {
                templateUrl: "templates/inicio.html",
                controller: 'ClienteController'
            }
        }
    })
    .state('menu',{
        url: '/menu/:dadosLogin',
        views: {
            'conteudo':{
                templateUrl: "templates/menu.html",
                controller: 'ClienteController'
            }
        }
    })
    .state('menu.dados', {
        url:'/acessos',
        views:{
            'tab-dados':{
                templateUrl: "templates/tab-dados.html"
            }
        }
    });

When the "tab" appears, it does not list the contents of <ion-nav-view name="tab-dados"></ion-nav-view> , only the "tabs" without content are listed.

    
asked by anonymous 06.07.2015 / 19:57

1 answer

2

This problem was caused by the parent hierarchy that is at the highest level not as "abstract: true" in its declaration, so all dependent children could not find the person responsible for entering the view.

$stateProvider
.state('Clientes', {
    url: '/clientes',
    views: {
        'conteudo': {
            templateUrl: "templates/inicio.html",
            controller: 'ClienteController'
        }
    }
})
.state('menu',{
    url: '/menu',
    abstract: true,
    views: {
        'conteudo':{
            templateUrl: "templates/menu.html"
        }
    }
})
.state('menu.dados', {
    url:'/acessos',
    views:{
        'tab-dados':{
            templateUrl: "templates/tab-dados.html"
        }
    }
});
    
08.09.2015 / 18:45