resource object data param, accept a function
See original GitHub issueI 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:
- Created 7 years ago
- Reactions:1
- Comments:11 (3 by maintainers)
Top 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 >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
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…
should work now: https://fullcalendar.io/docs/resources-json-feed
extraParams
is allowed to be a function