0
更新標題標題下面是我的路線 -如何動態地在離子
.state('profile', {
url: '/profile',
abstract: true,
templateUrl: 'templates/profile.html',
})
.state('profile.basics', {
url: '/profile-basics',
views: {
'profileContent': {
templateUrl: 'templates/profile-basics.html',
controller: 'profileCtrl'
}
},
})
在profile.html我有以下我需要動態更新的內容 -
<ion-header-bar class="bar-positive">
<h1 class="title">[THIS IS DYNAMIC CONTENT]</h1>
</ion-header-bar>
<ion-header-bar class="bar-stable bar-subheader">
<h1 class="title">[THIS TOO To BE MADE DYNAMIC]</h1>
</ion-header-bar>
<ion-nav-view name="profileContent"></ion-nav-view>
讓我知道是否有任何方式在離子標籤控制(動態控制內容),以便如果我訪問,profile.name
狀態它應該更新標題的名稱標題,如果我訪問,profile.address
狀態它應該更新標題地址標題等等。
它不會正常工作,因爲您可以看到該配置文件頁面沒有任何控制器與之關聯,並且我想在profile.html中保留一些常見的內容,因爲標題將出現在我的每一頁下一頁 –
上有'controller:'profileCtrl'',把它放在那裏。 –
是的,但我想把我的標題代碼只在profile.html頁面,而不是在profile-basics.html頁面 –