question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

resource object data param, accept a function

See original GitHub issue

I think I found an bug, see the following code:

resources: {
    url: 'http://jsbin.com/pizesi.js',
        data: function() {
            return { test: 1 };
        }
    },
events: {
    url: 'http://jsbin.com/silaziv.js',
    data: function() {
        return { test: 1 };
    }
}

When loading the page, two requests are made:

Resources: http://jsbin.com/pizesi.js?_=1464608570270
Events:    http://jsbin.com/silaziv.js?test=1&start=2015-08-07&end=2015-08-08&_=1464608570271

As you can see, the resources data isn’t present in the request URL. When data is a plain object (data: { test: 1 }) it does seem to work, but I need to pass the data using a function because it’s dynamic. Did I just found a bug?

JS Bin example: http://jsbin.com/zeveyazevo/1/edit?js,output

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Reactions:1
  • Comments:11 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
aampudiacommented, Feb 15, 2018

FullCalendar Resources.txt OK… this attached file is EXACTLY what i have in my application and it works, it might be not the most elegant solution, but it works! xD it should be a js file, but i had to upload it as txt,

the “act” variable is a variable that i use to know if jquery is asking for the resources or the events and respond accordingly…

0reactions
arshawcommented, Jun 24, 2020

should work now: https://fullcalendar.io/docs/resources-json-feed

extraParams is allowed to be a function

Read more comments on GitHub >

github_iconTop Results From Across the Web

The arguments object - JavaScript - MDN Web Docs - Mozilla
arguments is an Array-like object accessible inside functions that ... want to count how many parameters a function is declared to accept, ...
Read more >
Passing param object from $resource get method to restful ...
You are passing the string value 'empID' and 'deptID' at this line getSearchResult:{method:'GET', params:{eID:'empID',dID:'deptID'}} . · but the ...
Read more >
Object functions for ARM templates - Azure - Microsoft Learn
Describes the functions to use in an Azure Resource Manager template (ARM ... The function only accepts an even number of parameters.
Read more >
$resource - AngularJS: API
The function will be passed the current data value as an argument. Each key value in the parameter object is first bound to...
Read more >
Pass Parameters to a Service API - AWS Step Functions
You can include a JSON object directly in your state machine definition to pass as a parameter to a resource. For example, to...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found