Js-data-angular is an Angular wrapper for js-data that provides injectable resources, simple methods of binding data to the scope, and automatically registers the DSHttpAdapter using Angular's $http service.
Questions tagged [js-data-angular]
19 questions
3
votes
1 answer
JS-Data error: attrs must contain the property specified by idAttribute - with hasMany relations
Here's the error:
http://puu.sh/lXzja/f773fb6c9a.png
The primary key for my user model is username. The primary key for my routes is the routename. My api returns jsons inside data:{} as per jsonapi.org specs. Thus the id attribute is not in the…

Naila N
- 45
- 4
2
votes
1 answer
Angular JS-Data loading data from local file
I have an ionic app using angular and JS-Data that when running on a mobile device should load data from downloaded JSON files.
I am bundling the files with the app in the www folder and copying into the relevant storage folder depending on the…

Aine Poole
- 59
- 5
2
votes
1 answer
Unit testing promises in js-data-angular models
We use js-data and js-data-angular in our project.
I have the following model:
(function () {
'use strict';
angular.module('dash.models')
.factory('Diagnosis', ['DS', function (DS) {
function transform(resourcename, attrs, cb) {
…

daniel0mullins
- 1,937
- 5
- 21
- 45
1
vote
1 answer
ionic refresh with jsdata doesnt seem to work
My ionic app uses jsdata datastore for caching http://www.js-data.io/docs/home
. I am trying to implement the pull to refresh feature in my app using ion-refresher directive.
The doRefresh doesnot seem to make a Get Call at all. When I click on Pull…

javascript novice
- 777
- 2
- 9
- 28
1
vote
1 answer
Using jsdata objects without persisting them
I'm using js-data and js-data-angular. I have 2 resources, organization and address, an organization hasOne address.
I'm trying to create an organization (without persisting it) to be able to bind it to the html components. And set some default…

Mustela
- 191
- 3
- 12
1
vote
1 answer
How to push to an array in a js-data resource
I have a User object which has many route objects.
I load them like:
return User.find(username).then(function(user) {
return User.loadRelations(user.username, ['routes'])
.then(function(user) {
return user;
…

Naila N
- 45
- 4
0
votes
1 answer
How to solve dependency conflict between js-data-angular and js-data-http
I'm currently working on a project, the project has 2 npm packages installed:
js-data-http and js-data-angular.
The problem is js-data-http requires js-data@>=3.0.0 and js-data-angular requires js-data@>=2.0.0 <3. I've looked through all versions…

ArthurG
- 335
- 2
- 11
0
votes
2 answers
JSdata - Query to match all items in array (MongoDB '$all' keyword)
I'm using jsdata to create a local cache for an Angular 1.5 web application. I modelled my data with the according relations and everythings works fine. I'm struggeling with a query and I'm not even sure if this will work with js-data at all:
Lets…

IgSm
- 1
- 1
0
votes
0 answers
How to Deserialize null response in js-data
The find method in js-data-http appears to have a special case where if item is falsey then it will reject the promise, otherwise it returns item. My problem is that some falsey values (0, null, '') are valid responses from my API.
For example if I…

Rob
- 3,687
- 2
- 32
- 40
0
votes
1 answer
JS-Data slow jasmine tests after inject
I am having a JS-Data resource in angularjs, and every time I call inject on it in a (Jasmine) test, the test slows down, taking up to 700ms.
I am already doing an ejectAll() after each test. It is not doing any $http requests either, so I am out of…

Raymundus
- 2,173
- 1
- 20
- 35
0
votes
1 answer
How to get JSData DS#create() to persist to data store
From the code below, I would expect the console value to increase every time I run the save() function. However, the number does not update. So I'm not seeing any created values injected into the store on create.
Budget =…

Meeker
- 5,979
- 2
- 20
- 38
0
votes
1 answer
How to populate multiple js-data resources in one request
I have an AngularJS app that I am converting to use js-data. If I have a REST interface that returns a JSON object in this format
{
data: {
id: 1,
name: Test,
dept: 2
},
related: {
DeptList: [
{ Id: 1, Name: Dept1 },
…
0
votes
1 answer
Does [js-data] support no primary key?
I have log data that I wish to manage with js-data (http://www.js-data.io/docs/dsdefaults#idattribute) that has no primary key.
Do I need to generate a key or can js-data be configured to allow access to the data without a pk?
Can I get js-data to…

tarik
- 312
- 1
- 9
0
votes
1 answer
js-data: What is the difference between "none" and "inject" for DS "reapAction" configuration option?
I have the following definitions:
"none" - do nothing
"inject" - re-inject the items back into the data store
The above definition is taken from the official documentation. I don't understand what's the point of re-injecting items back into the…

tamakisquare
- 16,659
- 26
- 88
- 129
0
votes
1 answer
JSData: Sometimes resources are accessed nested under parent resource, and other times not. How is this determined?
I am integrating with an api that exposes child resources nested under parent resources.
This seems to work fine when I am finding or creating resources from JSData, however, updates and deletes seem to want to access the resource directly.
GET &…

Apie
- 6,371
- 7
- 27
- 25