fullcalendar / fullcalendar-angular

The official Angular component for FullCalendar
https://fullcalendar.io/docs/angular
MIT License
1.08k stars 177 forks source link

eventSources do not work with headers and adds params when not specified #344

Closed vinayverghese closed 4 years ago

vinayverghese commented 4 years ago

1) eventSources uses an HTTP GET call with headers for Authorization. Adding headers is an error and is not passed in the actual GET call.

    eventSources: [{
            url:  'http://hostname' + '/api',
                        headers: 'Authorization: Bearer' + token
            method: 'GET',
        }
        ]

a) using headers here leads to an error:

TS2322: Type '{ url: string; headers: { Authorization: string; }; }' is not assignable to type 'EventSourceInput'.   Object literal may only specify known properties, and 'headers' does not exist in type 'EventInput[] | EventSourceInputObject | EventSourceFunc

b) What we were trying to do originally is use an interceptor and pass a token, but this does not work here, which is why we were trying to do this. If HttpInterceptor would be able to handle this, it would be great.

2) eventSources url adds a start, end and timezone parameter when it is not required. There is no option to disable this.

acerix commented 4 years ago

I believe this existing ticket captures this need: https://github.com/fullcalendar/fullcalendar/issues/4627 ↑ Please visit the above issue, give a 👍 to vote (?), press the 🔈Subscribe button to receive updates.

Please refer to the support page and use Stack Overflow for help.

vinayverghese commented 4 years ago

Thanks - I was able to resolve it.