0
캘린더를 my ionic 앱에서 작동하도록 설정하고 캘린더와 moment.js를 bower를 통해 설치하려고했으나 오류가 발생하는 곳이 있습니다. TypeError : d는 함수가 아닙니다. 그리고 그것은 나를 "var previousDate = moment (vm.viewDate);"줄에 데려옵니다. mwlCalendar.js에 : 그것은 도움이 될 약 35angular-bootstrap-calendar TypeError : d가 함수가 아닙니다.
.controller('profileCtrl', function($scope, $state, User, calendarConfig, moment) {
//Calendar Stuff
$scope.calendarView = 'day';
$scope.viewDate = new Date();
var test = new Date('9/20/2016');
console.log(moment());
$scope.calendarTitle = "Test Calendar";
//test data
$scope.events = [{
title: 'My event title', // The title of the event
startsAt: new Date(2016, 10, 1, 1), // A javascript date object for when the event starts
endsAt: new Date(2016, 10, 26, 15), // Optional - a javascript date object for when the event ends
color: { // can also be calendarConfig.colorTypes.warning for shortcuts to the deprecated event types
primary: '#e3bc08', // the primary event color (should be darker than secondary)
secondary: '#fdf1ba' // the secondary event color (should be lighter than primary)
},
actions: [{ // an array of actions that will be displayed next to the event title
label: '<i class=\'glyphicon glyphicon-pencil\'></i>', // the label of the action
cssClass: 'edit-action', // a CSS class that will be added to the action element so you can implement custom styling
onClick: function(args) { // the action that occurs when it is clicked. The first argument will be an object containing the parent event
console.log('Edit event', args.calendarEvent);
}
}],
draggable: false, //Allow an event to be dragged and dropped
resizable: false, //Allow an event to be resizable
incrementsBadgeTotal: true, //If set to false then will not count towards the badge total amount on the month and year view
cssClass: 'a-css-class-name', //A CSS class (or more, just separate with spaces) that will be added to the event when it is displayed on each view. Useful for marking an event as selected/active etc
allDay: false // set to true to display the event as an all day event on the day view
}];
}
<div class="calendar" ng-hide="profile">
<mwl-calendar view="calendarView" view-date="viewDate" events="events" view-title="calendarTitle">
</mwl-calendar>
</div>
코드의 나머지 부분을 게시 독자는 무슨 일이 진행되는지 정확히 알 수 있습니다. 지금 당장은 외부의 사람들이 무슨 일이 일어나고 있는지 보는 것은 불가능합니다. 또한 크롬을 사용하고 개발자 모드로 들어가서 코드를 한 번씩 실행 해보는 것이 좋습니다. Chrome으로 디버깅하는 방법을 배우는 데는 다소 시간이 걸릴 수 있지만 그만한 가치가 있습니다. – Dale
내 HTML 및 컨트롤러 캘린더에 대한 내용입니다 – jayxC
잠재 고객이 유용하다고 생각한다면 직접 답변을 게시하십시오. – Dale