0
我在嘗試讓Angular Bootstrap日曆工作,並且我無法使上一個按鈕和下一個按鈕正常工作。只要依照指示,這裏就是我有下面的代碼:上一個按鈕和下一個按鈕不適用於Angular Bootstrap日曆
calendarControls.js
<div class="row">
<div class="col-md-6 text-center">
<div class="btn-group">
<button
class="btn btn-primary"
mwl-date-modifier
date="viewDate"
decrement="calendarView">
Previous
</button>
<button
class="btn btn-default"
mwl-date-modifier
date="viewDate"
set-to-today>
Today
</button>
<button
class="btn btn-primary"
mwl-date-modifier
date="viewDate"
increment="calendarView">
Next
</button>
</div>
</div>
</div>
頁面模板:
<ng-include src="'views/calendar/calendarControls.html'"></ng-include>
<mwl-calendar
view="calendarView"
view-date="calendarDate"
events="events"
view-title="calendarTitle"
cell-is-open="true">
</mwl-calendar>
我的UI路由器狀態和控制器:
$stateProvider
.state('home', {
url: '/',
templateUrl: 'views/home.html'
})
.state ('calendar', {
url : '/calendar',
templateUrl: 'views/calendar/index.html',
controller: function ($scope, $state,moment, calendarConfig) {
// Calendar configs
$scope.calendarView = 'month';
$scope.calendarDate = new Date();
$scope.calendarTitle = 'My Title';
$scope.events = [];
$scope.viewDate = moment().startOf('month').toDate();
calendarConfig.dateFormatter = 'moment';
calendarConfig.templates.calendarMonthCell = 'views/calendar/dayTemplate.html';
$scope.$on('$destroy', function() {
calendarConfig.templates.calendarMonthCell = 'mwl/calendarMonthCell.html';
});
},
});
除了像示例使用的範圍沒有使用vm之外,還有其他的東西顯而易見我很想念G?
謝謝。