Discussions
301 Moved Permanently
301 Moved Permanently
<a href=https://www.viagrapascherfr.com/>301 Moved Permanently!</a>
Posted by Lelandneink about 6 years ago
Remove file list from FormData in Angular JS
var request = {
method: 'POST',
url: rootDir + abc/ffft',
data: formdata,
headers: {
'Content-Type': undefined
},
success: (function (d) {
}),
error: (function (d) {
}),
complete: function (d) {
formdata.forEach(function (val, key, fD) {
console.log(key);
formdata.delete(key);
});
var files = formdata.getAll("file[]");
console.log("file" + files);
files.delete("file[]");
}
this service not working in file delete
Posted by ashish about 6 years ago
Handling form-data
Hello there! First of all, thank you for this awesome project. Really helpful to have a convenient model layer in the AngularJS world.
I have a question regarding form-data. Is there any documentation how to handle form-data with JS Data? I'm switching from $resource which allowed me to attach a CSV file to the request via a simple 'transformRequest' like this:
var data = $resource('/data/:id', {}, {
post: {
method: 'POST',
transformRequest: function(data) {
var fd = new FormData();
fd.append('file', data);
return fd;
},
headers: {'Content-Type': undefined}
}
};
I couldn't figure out how to do the same with JS Data.
Posted by Sebastian Henneberg over 8 years ago
Relations get not saved in object reference
Hi,
jsdata acctually makes a put and the rest stores the correct object but the promise of update still returns the old object in javascript.
Posted by Fabian Börner over 8 years ago
Testing
How im able to implement JSData into test, have a wrapper function thats depending on DS.find to acctually get some objects.
But as i execute it with an $httpBackend.expectGET('xxx').respond({'someobjectkey': 'someobjectvalue'});
JS data doesnt seem to execute anything on $http in this case.
Posted by Fabian Börner over 8 years ago
Data caching
Hi,
Is it possible to combine the localStorage module with js-angular-data and use it as a cache provider?
Thanks
Posted by Dimitris Mandekis over 8 years ago
Transform server response to match schema.
Hi Jason,
Is there a way to tell js-data to parse a resource response object differently ?
Let's say your server respond the following json :
```
{
"i": 123,
"n": "Alfred"
}
```
And you want your resource to be defined as follow :
```
DS.defineResource("person", {
schema: {
id: "string",
name: "string"
}
});
```
I know I can do it with a http request/response interceptor in AngularJS, but I would like to do it on the resource level.
Any idea ?
Posted by Arnaud Bosc over 8 years ago
Create nested resources trough parent
Is there a way to create associated records through the parent? Like in rails (http://api.rubyonrails.org/classes/ActiveRecord/NestedAttributes/ClassMethods.html)
Posted by Koen Swinkels over 8 years ago
Nested endpoint with shared id
I am attempting to use an API that has the following endpoint layout. I'm not sure how to define the resources in js-data to match it.
GET /api/buildings
Returns an array of buildings
GET /api/buildings/90
Returns an object containing a summary from the specified building
GET /api/buildings/90/info
Returns an object containing detailed information from the specified building
PUT /api/building/90/info
Update the information of a building
The building endpoint and the info endpoint share the same ID.
I have two resources defined: Building and BuildingInfo. My first thought was to define a belongsTo relationship in BuildingInfo with parent = true, however this results in js-data generating a url containing the ID twice (/api/building/90/info/90).
I suspect js-data does not support this use case currently. I'm hoping to find out how I can do it with minimal changes to js-data.
Posted by Matt Way over 8 years ago
json request suffix
How can you set a .json suffix to all requests? Like in restangular: https://github.com/mgonto/restangular#setrequestsuffix
Posted by Koen Swinkels over 8 years ago