2015-07-01 76 views
0

UI視圖的工作我使用的離子建立一個混合應用程序,我不能得到用戶界面視圖動態地顯示內容如何在離子

這是該指數

<body ng-app="starter"> 
<ion-pane> 
    <ion-header-bar class="bar-stable"> 
    <h1 class="title">Ionic Blank Starter</h1> 
    </ion-header-bar> 
    <ion-nav-view></ion-nav-view> 
</ion-pane> 
</body> 

爲我的理解ion-nav-view工作就像ui-view從角度ui路由。

這是我app.js

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

$stateProvider 

.state('login',{ 
    url: '/', 
    template: '<h1>hello</h1>' 
}) 

$urlRouterProvider.otherwise('/'); 

}) 

我想這個詞打招呼,顯示進入應用的根時,但不工作。它沒有顯示任何東西,也沒有給出任何控制檯錯誤。

回答

1

我懷疑「你好」在那裏,但它被<ion-header-bar>遮蔽了。嘗試將「has-header」作爲類添加到<ion-nav-view>元素中。該課程強制內容比平時低44px,以考慮標題欄。

這是一個工作CodePen。我所做的只是添加該課程。

+0

謝謝。你是對的。 – user3862830