离子视图变为空白

Ionic view goes blank

我遇到了这个问题:我的 Ionic 应用程序有这个路由模式

$stateProvider
    .state('tab', {
    url: '/tab',
    abstract: true,
    templateUrl: 'templates/tabs.html'
})
    .state('tab.plazas', {
    url: '/plazas',
    views: {
        'tab-plazas': {
            templateUrl: 'templates/tab-plazas.html',
            controller: 'PlazasCtrl'
        }
    }
})
    .state('tab.plaza-detalle', {
    url: '/plazas/:plazaId',
    views: {
        'tab-plazas': {
            templateUrl: 'templates/plaza-detalle.html',
            controller: 'PlazaDetalleCtrl'
        }
    }
})

    .state('tab.plaza-diagrama', {
    url: '/plazas/diagramaPlaza/:plazaId',
    views: {
        'tab-plazas': {
            templateUrl: 'templates/diagrama.html',
            controller: 'DiagramaCtrl'
        }
    }
});

我想从 plazas/:plazaId 内部转到 /plazas/diagramaPlaza/:plazaId,但是当我尝试这样做时,应用程序变为空白,当我在桌面上测试该应用程序时,它运行良好但是当我构建应用程序并使用我的 phone.

对其进行测试时出现白屏

是否知道此问题的原因?

非常感谢您的帮助。

我建议您首先为您的 route-configuration 配置一个 otherwise 方法,例如

$urlRouterProvider.otherwise('your default view');

如何转换为其他视图很重要,请尝试使用

$state.go('tab.plaza-diagrama');

这应该可以解决您的问题。