我想添加一個按鈕在標題欄的右側,按鈕顯示,但ng-click不會被解僱,如果我移動離子按鈕內容,它開始工作,只是不工作在標題。ng-click不起作用的離子頭按鈕
HTML:
<ion-view>
<ion-nav-bar class="bar-stable nav-title-slide-ios7" >
<ion-nav-back-button class="button-icon icon ion-ios7-arrow-back">
</ion-nav-back-button>
</ion-nav-bar>
<ion-header-bar>
<h1 class="title">Trips</h1>
<div class="buttons pull-right"><button class="button button-icon icon ion-plus" ng-click="createTrip()"></button></div>
</ion-header-bar>
<ion-content>
</ion-content>
</ion-view>
JS:
.controller('TripCtrl', function($scope, $location, $localStorage){
console.log('inside TripCtrl');
$scope.$storage = $localStorage;
var random1 = {
name : 'random name 1',
text : 'random text 1'
}
var random2 = {
name : 'random name 2',
text : 'random text 2'
}
$scope.trips = [];
$scope.trips.push(random1);
$scope.trips.push(random2);
$scope.createTrip = function(){
console.log('clicked create new');
$location.path('/createTrip');
}
})
需要更多的代碼,什麼控制器管理該按鈕點擊?從您提供的代碼中不清楚 – 2015-02-22 23:36:51