1
我一直難住這個問題一段時間了。當我在不同的子頁面之間導航時,離子內容被很好地更新,但是在重新加載頁面(使用網絡瀏覽器)之前,頁眉內容沒有顯示任何內容,我認爲它沒有意義,因爲我想製作一個移動應用程序。我動態加載內容(通過HTTP GET)動態更新標題在離子angularjs
在我的視圖中的一個,我中相應的控制器,用於在上述視圖以下
<ion-view cache-view="false">
<ion-nav-buttons side="right">
<button class="button button-icon icon ion-chevron-right"></button>
<ion-nav-buttons>
<ion-nav-buttons side="left">
<button class="button button-icon icon ion-chevron-left"></button>
<ion-nav-buttons>
<ion-nav-title>
<h1>{{header.title}}</h1>
</ion-nav-title>
<ion-content>
<ul class="list">
<li class="item item-checkbox" ng-repeat="item in list">
<label class="checkbox"> <input type="checkbox" ng-click="selectcategories(item.id)"
ng-checked="selection.indexOf(item.id) > -1"></label>
{{ item.catname |uppercase}}
</li>
</ul>
</ion-content>
</ion-view>
,我有
app.controller('usercategoryController',
function($scope,getcategories,$log)
{
$log.info("userCategoryController Called ...");
$scope.list=getcategories;
$scope.header={};
$scope.header.title="Categories";
});
我的應用程序配置爲:
app.config(['$stateProvider','$urlRouterProvider',
function($stateProvider,$urlRouterProvider)
{
$stateProvider
state('user',{
abstract:true,
url:"/user",
templateUrl:'views/user.html',
}).state('user.categories',{
url:"/categories",
templateUrl:'views/categories.html',
controller: 'usercategoryController',
resolve:{
getcategories: function(userService) {
return userService.getcategories();
}
},
})
$urlRouterProvider.otherwise('/user');
}
]);
,這裏是我的抽象觀點
<ion-nav-bar class="bar bar-header bar-positive">
</ion-nav-bar>
<ion-nav-view animation="slide-left-right"></ion-nav-view>
它總是顯示一個藍色標題,裏面沒有內容,直到我重新加載瀏覽器。對於標題標題,我嘗試了title和view-title屬性,但都沒有成功。
,如果有人有一個解決方案,請讓我知道