You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Apr 11, 2019. It is now read-only.
Copy file name to clipboardExpand all lines: README.md
+34-6Lines changed: 34 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -99,14 +99,15 @@ gulp serve
99
99
bower install angular-jsonapi --save
100
100
~~~
101
101
102
-
* Include `angular-jsonapi` and sources modules (`angular-jsonapi-rest`, `angular-jsonapi-local`) in your module's dependencies:
102
+
* Include `angular-jsonapi` and sources modules (available: `angular-jsonapi-rest`, `angular-jsonapi-local`, `angular-jsonapi-parse`) in your module's dependencies:
103
103
104
104
~~~javascript
105
105
// in your js app's module definition
106
106
angular.module('myApp', [
107
107
'angular-jsonapi',
108
108
'angular-jsonapi-rest',
109
-
'angular-jsonapi-local'
109
+
'angular-jsonapi-local',
110
+
'angular-jsonapi-parse'
110
111
]);
111
112
~~~
112
113
@@ -316,23 +317,23 @@ To use this source you must include `angular-jsonapi-local` in your module depen
316
317
Source constructor takes one argument - prefix for local store objects, default value is `AngularJsonAPI`.
317
318
318
319
~~~javascript
319
-
var localeSynchro = $jsonapi.sourceLocal.create('AngularJsonAPI');
320
+
var localSynchro = $jsonapi.sourceLocal.create('Local synchro', 'AngularJsonAPI');
320
321
321
322
~~~
322
323
323
324
**Keep in mind that the localStorage size is limited to approx. 5MB on most devices. Exceeding this limit can cause unpredicted results.**
324
325
325
326
### SourceRest
326
327
327
-
Is a simple synchronizer with the RESTAPI supporting JSON API format. It performs following operations:
328
+
Is a simple source with the RESTAPI supporting JSON API format. It performs following operations:
328
329
`remove`, `unlink`, `link`, `update`, `add`, `all`, `get`. Every time the data changes the suitable request is made to keep your data synchronized.
329
330
330
331
To use this source you must include `angular-jsonapi-rest` in your module dependencies.
331
332
332
333
Source constructor takes 2 arguments: `name` and `url` of the resource, there is no default value.
333
334
334
335
~~~javascript
335
-
var novelsSynchro = $jsonapi.sourceRest.create('localhost:3000/novels');
336
+
var restSynchro = $jsonapi.sourceRest.create('Rest synchro', 'localhost:3000/novels');
336
337
337
338
~~~
338
339
@@ -348,6 +349,31 @@ Encodes params object into `jsonapi` url params schema. Returned object can be t
348
349
349
350
Decodes params from `jsonapi` url schema (e.g. obtained by `$location.search()).
350
351
352
+
### SourceParse
353
+
354
+
**alpha stage, not all options are supported**
355
+
356
+
If you like the way object are managed by this package, but still you want to use awesome Parse.com API possibilities I got something for you!
357
+
358
+
SourceParse maps [parse.com](https://parse.com) js sdk to angular-jsonapi schema. It performs following operations:
359
+
`remove`, `update`, `add`, `all`, `get`. Every time the data changes the suitable request is made to keep your data synchronized.
360
+
361
+
`unlink`, `link` operations for hasOne relationship can be made by setting appropriate key to the linked object Id. HasMany relationships are not supported yet.
362
+
363
+
To use this source you must include `angular-jsonapi-parse` in your module dependencies.
364
+
365
+
Source constructor takes 2 arguments: `name`, `table` there is no default value. `table` is a name of the mapped object table in [parse.com](https://parse.com) API (usually starts with the capital letter and is singular)
366
+
367
+
**If you do not use [parse.com](https://parse.com) sdk in other project parts, you have to initialize the source first by calling `parseSynchro.initialize(appId, jsKey)`**
368
+
369
+
~~~javascript
370
+
var parseSynchro = $jsonapi.sourceParse.create('Parse synchro', 'Novel');
371
+
372
+
//Only if you do not call Parse.initialize somewhere else
@@ -483,6 +509,7 @@ Params must be an object that can contain keys:
483
509
484
510
***include**- string with comma delimited relationships that will override schema settings.
485
511
***filter**- object with`attribute: value`values. Filters are used as 'exact match' (only objects with`attribute` value same as `value` are returned). `value` can also be an array, then only objects with same `attribute` value as one of`values` array elements are returned.
512
+
***limit**- sets quota limit for [parse.com source](#SourceParse).
486
513
487
514
Those two keys are supported explicitly, but other keys will also be passed to the synchronization.
488
515
@@ -733,11 +760,12 @@ Adds each error to `errorsObject.errors[key]`.
733
760
## 1.0.0-alpha.7 (in progress)
734
761
* [x] fix for one side relationships
735
762
* [x] fix for collection.pristine
763
+
* [x] Parse.com source alpha
736
764
737
765
## 1.0.0-alpha.*
766
+
* [ ] Parse.com source full support
738
767
* [ ] I18n support (medium)
739
768
* [ ] File source
740
-
* [ ] Parse.com source
741
769
* [ ] Add objects for hasMany/hasOne relationship (medium)
742
770
* [ ] Protect object attributes from being edited explicitly (without form -> save) (medium)
0 commit comments