我正在使用UI-Calendar(http://arshaw.com/fullcalendar/),我希望填写的表单在相应的日历条目中显示并保存在firebase数据库中。我该怎么办?目前表格数据没有在日历上显示出来?
appointment-maker.js文件
'use strict';
/**
* @ngdoc function
* @name appointment1App.controller:CalendarCtrl
* @description
* # CalendarCtrl
* Controller of the appointment1App
*/
angular.module('Appointment1app')
.controller('CalendarCtrl', function ($scope) {
function dayClick() {
$scope.templates.myTemplate = "views/appointment-maker.html";
}
function eventDrop() {
}
function alertOnResize() {
}
$scope.eventSources = [];
$scope.uiConfig = {
calendar: {
height: 450,
editable: true,
header: {
left: 'month basicWeek basicDay agendaWeek agendaDay',
center: 'title',
right: 'today prev,next'
},
dayClick: dayClick,
eventDrop: eventDrop,
eventResize: alertOnResize
}
};
});
calendar.js
'use strict';
/**
* @ngdoc function
* @name appointment1App.controller:CalendarCtrl
* @description
* # CalendarCtrl
* Controller of the appointment1App
*/
angular.module('Appointment1app')
.controller('CalendarCtrl', function ($scope) {
function dayClick() {
$scope.templates.myTemplate = "views/appointment-maker.html";
}
function eventDrop() {
}
function alertOnResize() {
}
$scope.eventSources = [];
$scope.uiConfig = {
calendar: {
height: 450,
editable: true,
header: {
left: 'month basicWeek basicDay agendaWeek agendaDay',
center: 'title',
right: 'today prev,next'
},
dayClick: dayClick,
eventDrop: eventDrop,
eventResize: alertOnResize
}
};
});
HTML
<form ng-controller="AppointmentMakerCtrl"
ng-submit="onSubmitAppointment()">
<div class="form-group">
<label>Name</label>
<input class="form-control"
ng-model="newAppointment.name">
<label>Email</label>
<input class="form-control"
ng-model="newAppointment.email">
<label>Notes</label>
<input class="form-control"
ng-model="newAppointment.notes">
</div>
<button class="btn btn-primary" type="submit"
ng-click="onCreateAppointment()">Create Appointment</button>
<!-- <ul>
<li ng-repeat="message in messages">{{message.value}}</li>
</ul> -->
</form>
config.js文件
.constant('FBURL', 'http://dazzling-fire-6922.firebaseio.com');