Skip to content
This repository has been archived by the owner on Sep 8, 2020. It is now read-only.

Added resourceWatcher #354

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Conversation

gusreyes01
Copy link

Resources are supported and work with FullCalendar Scheduler Plugin.

Resources are supported and work with FullCalendar Scheduler Plugin.
@@ -98,6 +109,7 @@ angular.module('ui.calendar', [])
this.changeWatcher = function(arraySource, tokenFn) {
var self;
var getTokens = function() {
// console.log(arraySource);
var array = angular.isFunction(arraySource) ? arraySource() : arraySource;
var result = [], token, el;
for (var i = 0, n = array.length; i < n; i++) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Travis fails here since test files where not updated. Therefore scope.resources is undefined.
I believe line 238 should be modified (see comment there)

@antoinepairet
Copy link
Contributor

@gusreyes01 Thanks for your PR. I am looking forward having this merged into master :-)
We need to fix failing tests and might need to write new ones to make sure everything works as expected. @jkurz what do you think?

@philnorton
Copy link

Hey, just commenting here to see if the Scheduler module will be compatible with Angular?

@Babugoli
Copy link

Hi @antoinepairet

Did you get scheduler working with uiCalender directive.

Thanks

@antoinepairet
Copy link
Contributor

antoinepairet commented Aug 14, 2017 via email

@Babugoli
Copy link

hi @antoinepairet

it doesnt work for me, i used final changes from raw source, do you mind helping or share sample you using with calendar.js file

here is how I'm using

$scope.uiConfig = {
calendar: {
height: 520,
editable: true,
header: {
left: 'title',
center: '',
right: 'timelineDay,timelineThreeDays,agendaWeek'
},
droppable: true,
defaultView: 'timelineDay',
theme: true,
resourceLabelText: 'Team',
//events: $scope.loadEvents,
eventClick: $scope.alertOnEventClick,
eventDrop: $scope.alertOnDrop,
eventResize: $scope.alertOnResize,
eventRender: $scope.eventRender,
dayClick: $scope.dayClick,
// drop: $scope.drop,

        //removeEvents:$scope.removeEvents,
    }
};

$scope.events = [
{ id: '1', resourceId: 'a', start: '2016-01-07T02:00:00', end: '2016-01-07T07:00:00', title: 'event 1' },
{ id: '2', resourceId: 'b', start: '2016-01-07T05:00:00', end: '2016-01-07T22:00:00', title: 'event 2' },
{ id: '3', resourceId: 'c', start: '2016-01-06', end: '2016-01-08', title: 'event 3' },
{ id: '4', resourceId: 'd', start: '2016-01-07T03:00:00', end: '2016-01-07T08:00:00', title: 'event 4' },
{ id: '5', resourceId: 'e', start: '2016-01-07T00:30:00', end: '2016-01-07T02:30:00', title: 'event 5' }
];

    $scope.eventSources = [$scope.events];

    $scope.eventResources = [
			{ id: 'a', title: 'User 1' },
			{ id: 'b', title: 'User 2', eventColor: 'green' },
			{ id: 'c', title: 'User 3', eventColor: 'orange' },
			{ id: 'd', title: 'User 4' },
			{ id: 'e', title: 'User 5', eventColor: 'red' },
    ];

I do find error as b.class is not a constructor

@Babugoli
Copy link

thanks @antoinepairet works for me too. appreciate for getting back

@seemsjames
Copy link

Hello
I have used angular-ui calendar i am facing same error like b.class is not a constructor.
How to solve this one.
thanks

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants