2016-06-13 35 views
0
angular.module('starter', ['ionic', 'starter.controllers', 'starter.services']) 

.run(function($ionicPlatform) { 
    $ionicPlatform.ready(function() { 

    if (window.cordova && window.cordova.plugins && window.cordova.plugins.Keyboard) { 
     cordova.plugins.Keyboard.hideKeyboardAccessoryBar(true); 
     cordova.plugins.Keyboard.disableScroll(true); 

    } 
    if (window.StatusBar) { 
     // org.apache.cordova.statusbar required 
     StatusBar.styleDefault(); 
    } 
    }); 
}) 

.config(function($stateProvider, $urlRouterProvider) { 


    $stateProvider 


    .state('tab', { 
    url: '/tab', 
    abstract: true, 
    templateUrl: 'templates/tabs.html' 
    }) 



    .state('notePadHome', { 
    url: '/notePadHome', 
    views: { 
     'notePadHome': { 
     templateUrl: 'templates/notePadHome.html', 
     controller: 'DashCtrl' 
     } 
    } 
    }) 


    $urlRouterProvider.otherwise('/notePadHome'); 

}); 
+0

你在控制台中是否有错误?在控制台中可以看到视图的路径是否正确并加载 – AlainIb

+0

否没有任何错误。 –

+0

你尝试过什么?什么网址的视图谁不是渲染 – AlainIb

回答

0

在tabs.html你需要离子导航视图元素名称=“选项卡”申请。

,然后在app.js试试这个:

.state('notePadHome', { 
url: '/notePadHome', 
views: { 
    'tab': { 
    templateUrl: 'templates/notePadHome.html', 
    controller: 'DashCtrl' 
    } 
} 
}) 

如果你想从app.js删除的选项卡,记得也删除它在你的家查看路线,像这样:

.state('notePadHome', { 
url: '/notePadHome', 
templateUrl: 'templates/notePadHome.html', 
controller: 'DashCtrl' 

}) 
+0

我不能完全删除从app.js选项卡?然后使用ion-nav -view in notepadHome.thml –

+0

是的,如果你只需要在你的家中的菜单,你可以做到这一点。 – Bellu

+0

感谢它的工作 –

相关问题