diff --git a/CHANGELOG.md b/CHANGELOG.md
index a651e8b..f6fedd3 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,9 +1,20 @@
-##### 2.0.0-alpha.1-0 - xx December 2014
+##### 2.0.0 - 03 February 2015
+
+_Note:_ Please see the [js-data CHANGELOG](https://github.com/js-data/js-data/blob/master/CHANGELOG.md).
###### Breaking API changes
+- Angular module renamed from `angular-data.DS` to `js-data`
- Refactored to be a wrapper for [js-data](https://github.com/js-data/js-data)
- `deserialize` and `serialize` are now properties of `DSHttpAdapter.defaults`
-- All hooks (`validate`, `afterCreate`, `serialize`, etc.) now take the resource definition as the first argument instead of just the name of the resource
+- `deserialize` and `serialize` are now configuration options used solely by the http adapter
+- All hooks (`validate`, `afterCreate`, `serialize`, etc.) now take the actual resource definition as the first argument instead of just the name of the resource
+- `DSLocalStorageAdapter` is no longer bundled, but is each separate from js-data-angular.
+- The API for `bindOne` and `bindAll` has been changed to be more consistent with the rest of the API
+- `eagerInject` has not yet been implemented in `js-data`.
+
+##### Backwards compatible API changes
+- GitHub project renamed to js-data-angular
+- GitHub project moved to the js-data organization
###### Other
- #199 - Re-implement bindOne & bindAll in js-data-angular (they're missing from js-data)
diff --git a/LICENSE b/LICENSE
index 483a55e..460f8ee 100644
--- a/LICENSE
+++ b/LICENSE
@@ -1,6 +1,6 @@
The MIT License (MIT)
-Copyright (c) 2014 Jason Dobry
+Copyright (c) 2014-2015 Jason Dobry
Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
diff --git a/README.md b/README.md
index 3d977ea..e79ccb2 100644
--- a/README.md
+++ b/README.md
@@ -1,17 +1,35 @@
-## js-data-angular
+## js-data-angular [](http://badge.fury.io/bo/js-data-angular) [](http://badge.fury.io/js/js-data-angular)
Angular wrapper for [js-data](http://www.js-data.io).
-#### What about Angular-data?
-Documentation for Angular-data 1.x can be found at [angular-data.pseudobry.com](http://angular-data.pseudobry.com).
-
-## API Documentation
-[DS](http://www.js-data.io/docs/js-data-angular)
-
-## Demo
-[js-data-angular.firebaseapp.com/](https://js-data-angular.firebaseapp.com/)
+#### What happened Angular-data?
+Js-data-angular is Angular-data 2.0, with [js-data](http://www.js-data.io) as the framework-agnostic core. Documentation for Angular-data 1.x can be found at [angular-data.pseudobry.com](http://angular-data.pseudobry.com).
+
+## Guides
+- [Angular + JSData (js-data-angular)](http://www.js-data.io/docs/js-data-angular)
+- [Getting Started with js-data](http://www.js-data.io/docs/home)
+- [Resources/Models](http://www.js-data.io/docs/resources)
+- [Working with the Data Store](http://www.js-data.io/docs/working-with-the-data-store)
+- [Adapters](http://www.js-data.io/docs/working-with-adapters)
+- [Model Lifecycle](http://www.js-data.io/docs/model-lifecycle)
+- [Custom Instance Behavior](http://www.js-data.io/docs/custom-instance-behavior)
+- [Computed Properties](http://www.js-data.io/docs/computed-properties)
+- [Relations](http://www.js-data.io/docs/relations)
+- [Schemata & Validation](http://www.js-data.io/docs/schemata--validation)
+- [FAQ](http://www.js-data.io/docs/faq)
+
+## Js-data-angular API Documentation
+- [js-data-angular](http://www.js-data.io/docs/js-data-angular)
+- [DS](http://www.js-data.io/docs/ds)
+- [js-data-schema](http://www.js-data.io/docs/js-data-schema)
+- [DSHttpAdapter](http://www.js-data.io/docs/dshttpadapter)
+- [DSLocalStorageAdapter](http://www.js-data.io/docs/dslocalstorageadapter)
+- [DSLocalForageAdapter](http://www.js-data.io/docs/dslocalforageadapter)
+- [DSFirebaseAdapter](http://www.js-data.io/docs/dsfirebaseadapter)
+- [DSRedisAdapter](http://www.js-data.io/docs/dsredisadapter)
+- [DSRethinkDBAdapter](http://www.js-data.io/docs/dsrethinkdbadapter)
## Project Status
@@ -29,8 +47,6 @@ Documentation for Angular-data 1.x can be found at [angular-data.pseudobry.com](
Load `js-data-angular.js` after `js-data.js`.
-__Note:__ You only have to use `js-data-http` if you want to use the `DSHttpAdapter`.
-
```js
angular.module('myApp', ['js-data']);
```
@@ -100,7 +116,7 @@ First, feel free to contact me with questions. [Mailing List](https://groups.io/
The MIT License (MIT)
-Copyright (c) 2014 Jason Dobry
+Copyright (c) 2014-2015 Jason Dobry
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
diff --git a/TRANSITION.md b/TRANSITION.md
index d1bc83b..c91ec04 100644
--- a/TRANSITION.md
+++ b/TRANSITION.md
@@ -1,3 +1,49 @@
+### 1.x ---> 2.x - 03 February 2015
+
+#### Breaking API changes
+
+##### Module name change
+
+###### Before
+`angular.module('myApp', ['angular-data.DS'])`
+
+###### After
+`angular.module('myApp', ['js-data'])`
+
+##### `bindOne` and `bindAll` syntax change
+
+###### Before
+[bindOne](http://angular-data.pseudobry.com/documentation/api/angular-data/DS.sync%20methods_bindOne) and [bindAll](http://angular-data.pseudobry.com/documentation/api/angular-data/DS.sync%20methods_bindAll)
+
+###### After
+[bindOne](http://www.js-data.io/docs/js-data-angular#dsbindone) and [bindAll](http://www.js-data.io/docs/js-data-angular#dsbindall)
+
+#### Backwards compatible API changes
+
+##### Repo re-assignment and name change
+
+###### Before
+`https://github.com/jmdobry/angular-data.git`
+
+###### After
+`https://github.com/js-data/js-data-angular.git`
+
+##### New Bower package
+
+###### Before
+`bower install --save angular-data`
+
+###### After
+`bower install --save js-data-angular`
+
+##### New NPM package
+
+###### Before
+`npm install --save angular-data`
+
+###### After
+`npm install --save js-data js-data-angular`
+
### 0.9.x. ---> 0.10.x - 29 June 2014
#### Breaking API changes
@@ -64,17 +110,17 @@ DSProvider.defaults.filter = function (resourceName, where, attrs) {
DSProvider.defaults.filter = function (collection, resourceName, params, options) {
// examine params and
// decide whether to exclude items, skip items, start from an offset, or sort the items
-
- // see the [default implementation that ships with js-data-angular](https://github.com/js-data/js-data-angular/blob/master/src/datastore/index.js#L12)
+
+ // see the [default implementation that ships with js-data-angular](https://github.com/js-data/js-data-angular/blob/master/src/datastore/index.js#L12)
// overriding this method is useful when our server only understands a certain
// params format and you want js-data-angular's filter to behave the same as your server
-
+
// js-data-angular looks for the following fields:
// - where
// - skip (or offset)
// - limit
// - orderBy (or sort)
-
+
// return the filtered collection
};
```
diff --git a/bower.json b/bower.json
index 7788da3..ed8e8d9 100644
--- a/bower.json
+++ b/bower.json
@@ -2,13 +2,12 @@
"author": "Jason Dobry",
"name": "js-data-angular",
"description": "Angular wrapper for js-data (originally angular-data).",
- "version": "2.0.0-alpha.3-3",
"homepage": "http://www.js-data.io/docs/js-data-angular",
"repository": {
"type": "git",
"url": "https://github.com/js-data/js-data-angular.git"
},
- "main": "./dist/js-data-angular.min.js",
+ "main": "./dist/js-data-angular.js",
"ignore": [
".idea/",
".*",
@@ -29,10 +28,7 @@
"angular-mocks-1.3.2": "angular-mocks#1.3.2"
},
"dependencies": {
- "js-data": "~1.0.x",
- "angular": "~1.x"
- },
- "resolutions": {
- "angular": "1.3.2"
+ "js-data": ">=1.0.0",
+ "angular": ">=1.0.3"
}
}
diff --git a/dist/js-data-angular.js b/dist/js-data-angular.js
index 083b00f..ee7059d 100644
--- a/dist/js-data-angular.js
+++ b/dist/js-data-angular.js
@@ -1,7 +1,7 @@
/**
* @author Jason Dobry
* @file js-data-angular.js
-* @version 2.0.0-alpha.3-3 - Homepage
+* @version 2.0.0 - Homepage
* @copyright (c) 2014 Jason Dobry
* @license MIT
*
@@ -216,16 +216,21 @@
DSUtils.Promise = QPromise;
// Register any adapters that have been loaded
- for (var i = 0; i < adapters.length; i++) {
- if (adapters[i].loaded) {
- store.registerAdapter(adapters[i].name, arguments[i]);
+ if (args.length) {
+ for (var i = 0; i < args.length; i++) {
+ for (var j = 0; j < adapters.length; j++) {
+ if (adapters[j].loaded && !adapters[j].registered) {
+ adapters[j].registered = true;
+ store.registerAdapter(adapters[j].name, args[i]);
+ }
+ }
}
}
// Wrap certain sync functions with $apply
- for (i = 0; i < functionsToWrap.length; i++) {
- originals[functionsToWrap[i]] = store[functionsToWrap[i]];
- store[functionsToWrap[i]] = (function (name) {
+ for (var k = 0; k < functionsToWrap.length; k++) {
+ originals[functionsToWrap[k]] = store[functionsToWrap[k]];
+ store[functionsToWrap[k]] = (function (name) {
return function () {
var args = arguments;
if (!$rootScope.$$phase) {
@@ -235,16 +240,14 @@
}
return originals[name].apply(store, args);
};
- })(functionsToWrap[i]);
+ })(functionsToWrap[k]);
}
- // Hook into the digest loop (throttled)
- if (typeof Object.observe !== 'function' ||
- typeof Array.observe !== 'function') {
+ // Hook into the digest loop
+ if (typeof Object.observe !== 'function' || typeof Array.observe !== 'function') {
$rootScope.$watch(function () {
- // Throttle angular-data's digest loop to tenths of a second
- return new Date().getTime() / 100 | 0;
- }, store.observe.Platform.performMicrotaskCheckpoint);
+ store.observe.Platform.performMicrotaskCheckpoint();
+ });
}
return store;
diff --git a/dist/js-data-angular.min.js b/dist/js-data-angular.min.js
index c802274..1806b8c 100644
--- a/dist/js-data-angular.min.js
+++ b/dist/js-data-angular.min.js
@@ -1,10 +1,10 @@
/**
* @author Jason Dobry
* @file js-data-angular.min.js
-* @version 2.0.0-alpha.3-3 - Homepage
+* @version 2.0.0 - Homepage
* @copyright (c) 2014 Jason Dobry
* @license MIT
*
* @overview Angular wrapper for js-data.
*/
-!function a(b,c,d){function e(g,h){if(!c[g]){if(!b[g]){var i="function"==typeof require&&require;if(!h&&i)return i(g,!0);if(f)return f(g,!0);var j=new Error("Cannot find module '"+g+"'");throw j.code="MODULE_NOT_FOUND",j}var k=c[g]={exports:{}};b[g][0].call(k.exports,function(a){var c=b[g][1][a];return e(c?c:a)},k,k.exports,a,b,c,d)}return c[g].exports}for(var f="function"==typeof require&&require,g=0;g=200&&a.status<300?(e.defaults.log&&e.defaults.log(b,a),a):(e.defaults.error&&e.defaults.error("FAILED: "+b,a),d.reject(a))}var e=this,f=new Date;return a=k(a,e.defaults.httpConfig),e.defaults.forceTrailingSlash&&"/"!==a.url[a.url.length]&&(a.url+="/"),a.method=a.method.toUpperCase(),b(a).then(c,c)};var e=new f(a.defaults);return c.registerAdapter("http",e,{"default":!0}),e}]}),c.module("js-data").run(["DS","DSHttpAdapter",function(a,b){a.registerAdapter("http",b,{"default":!0})}])}}(window,window.angular)},{"js-data":"js-data"}]},{},[1]);
\ No newline at end of file
+!function a(b,c,d){function e(g,h){if(!c[g]){if(!b[g]){var i="function"==typeof require&&require;if(!h&&i)return i(g,!0);if(f)return f(g,!0);var j=new Error("Cannot find module '"+g+"'");throw j.code="MODULE_NOT_FOUND",j}var k=c[g]={exports:{}};b[g][0].call(k.exports,function(a){var c=b[g][1][a];return e(c?c:a)},k,k.exports,a,b,c,d)}return c[g].exports}for(var f="function"==typeof require&&require,g=0;g=200&&a.status<300?(e.defaults.log&&e.defaults.log(b,a),a):(e.defaults.error&&e.defaults.error("FAILED: "+b,a),d.reject(a))}var e=this,f=new Date;return a=k(a,e.defaults.httpConfig),e.defaults.forceTrailingSlash&&"/"!==a.url[a.url.length]&&(a.url+="/"),a.method=a.method.toUpperCase(),b(a).then(c,c)};var e=new f(a.defaults);return c.registerAdapter("http",e,{"default":!0}),e}]}),c.module("js-data").run(["DS","DSHttpAdapter",function(a,b){a.registerAdapter("http",b,{"default":!0})}])}}(window,window.angular)},{"js-data":"js-data"}]},{},[1]);
\ No newline at end of file
diff --git a/package.json b/package.json
index 2f02850..92fcff8 100644
--- a/package.json
+++ b/package.json
@@ -1,7 +1,7 @@
{
"name": "js-data-angular",
"description": "Angular wrapper for js-data.",
- "version": "2.0.0-alpha.3-3",
+ "version": "2.0.0",
"homepage": "http://www.js-data.io/docs/js-data-angular",
"repository": {
"type": "git",
@@ -18,33 +18,34 @@
"url": "https://github.com/js-data/js-data-angular/blob/master/LICENSE"
}
],
+ "main": "src/index.js",
"devDependencies": {
"grunt": "0.4.5",
- "grunt-browserify": "3.2.1",
+ "grunt-browserify": "3.3.0",
"grunt-contrib-clean": "0.6.0",
- "grunt-contrib-jshint": "0.10.0",
- "grunt-contrib-uglify": "0.6.0",
+ "grunt-contrib-jshint": "0.11.0",
+ "grunt-contrib-uglify": "0.7.0",
"grunt-contrib-watch": "0.6.1",
- "grunt-karma": "0.9.0",
+ "grunt-karma": "0.10.1",
"grunt-karma-coveralls": "2.5.3",
- "karma": "0.12.28",
+ "karma": "0.12.31",
"karma-chai": "0.1.0",
"karma-chrome-launcher": "0.1.7",
"karma-coverage": "0.2.7",
"karma-script-launcher": "0.1.0",
- "karma-firefox-launcher": "0.1.3",
+ "karma-firefox-launcher": "0.1.4",
"karma-phantomjs-launcher": "0.1.4",
"karma-mocha": "0.1.10",
"karma-sinon": "1.0.4",
- "karma-spec-reporter": "0.0.13",
+ "karma-spec-reporter": "0.0.16",
"time-grunt": "1.0.0",
- "jit-grunt": "0.9.0"
+ "jit-grunt": "0.9.1"
},
"scripts": {
"test": "grunt test"
},
"dependencies": {
"mout": "0.11.0",
- "js-data": "^1.0.0-alpha.5-8"
+ "js-data": ">=1.0.0"
}
}
diff --git a/src/index.js b/src/index.js
index 7e14edb..b004a5f 100644
--- a/src/index.js
+++ b/src/index.js
@@ -206,16 +206,21 @@
DSUtils.Promise = QPromise;
// Register any adapters that have been loaded
- for (var i = 0; i < adapters.length; i++) {
- if (adapters[i].loaded) {
- store.registerAdapter(adapters[i].name, arguments[i]);
+ if (args.length) {
+ for (var i = 0; i < args.length; i++) {
+ for (var j = 0; j < adapters.length; j++) {
+ if (adapters[j].loaded && !adapters[j].registered) {
+ adapters[j].registered = true;
+ store.registerAdapter(adapters[j].name, args[i]);
+ }
+ }
}
}
// Wrap certain sync functions with $apply
- for (i = 0; i < functionsToWrap.length; i++) {
- originals[functionsToWrap[i]] = store[functionsToWrap[i]];
- store[functionsToWrap[i]] = (function (name) {
+ for (var k = 0; k < functionsToWrap.length; k++) {
+ originals[functionsToWrap[k]] = store[functionsToWrap[k]];
+ store[functionsToWrap[k]] = (function (name) {
return function () {
var args = arguments;
if (!$rootScope.$$phase) {
@@ -225,16 +230,14 @@
}
return originals[name].apply(store, args);
};
- })(functionsToWrap[i]);
+ })(functionsToWrap[k]);
}
- // Hook into the digest loop (throttled)
- if (typeof Object.observe !== 'function' ||
- typeof Array.observe !== 'function') {
+ // Hook into the digest loop
+ if (typeof Object.observe !== 'function' || typeof Array.observe !== 'function') {
$rootScope.$watch(function () {
- // Throttle angular-data's digest loop to tenths of a second
- return new Date().getTime() / 100 | 0;
- }, store.observe.Platform.performMicrotaskCheckpoint);
+ store.observe.Platform.performMicrotaskCheckpoint();
+ });
}
return store;