Skip to content

Commit 05c4e7a

Browse files
committed
Stable Version 2.2.2.
Fixes #312 Fixes #313
1 parent 2176abd commit 05c4e7a

12 files changed

+68
-75
lines changed

.travis.yml

-13
This file was deleted.

CHANGELOG.md

+6
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
##### 2.2.2 - 04 March 2015
2+
3+
###### Backwards compatible bug fixes
4+
- #312 - UMDifying js-data-angular
5+
- #313 - DSHttpAdapter#find/create/update/destroy do not call queryTransform
6+
17
##### 2.2.1 - 25 February 2015
28

39
###### Backwards compatible bug fixes

Gruntfile.js

+7-23
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
* js-data-angular
33
* http://github.com/js-data/js-data-angular
44
*
5-
* Copyright (c) 2014 Jason Dobry <http://www.js-data.io/js-data-angular>
5+
* Copyright (c) 2014-2015 Jason Dobry <http://www.js-data.io/docs/js-data-angular>
66
* Licensed under the MIT license. <https://github.com/js-data/js-data-angular/blob/master/LICENSE>
77
*/
88
module.exports = function (grunt) {
@@ -40,7 +40,7 @@ module.exports = function (grunt) {
4040
'* @author Jason Dobry <[email protected]>\n' +
4141
'* @file js-data-angular.min.js\n' +
4242
'* @version <%= pkg.version %> - Homepage <https://www.js-data.io/js-data-angular/>\n' +
43-
'* @copyright (c) 2014 Jason Dobry <https://github.com/jmdobry/>\n' +
43+
'* @copyright (c) 2014-2015 Jason Dobry <https://github.com/jmdobry/>\n' +
4444
'* @license MIT <https://github.com/js-data/js-data-angular/blob/master/LICENSE>\n' +
4545
'*\n' +
4646
'* @overview Angular wrapper for js-data.\n' +
@@ -49,21 +49,6 @@ module.exports = function (grunt) {
4949
files: {
5050
'dist/js-data-angular.min.js': ['dist/js-data-angular.js']
5151
}
52-
},
53-
scripts: {
54-
files: {
55-
'doc/resources/js/libs.min.js': ['doc/resources/js/libs.js']
56-
}
57-
}
58-
},
59-
browserify: {
60-
options: {
61-
external: ['js-data']
62-
},
63-
dist: {
64-
files: {
65-
'dist/js-data-angular.js': ['src/index.js']
66-
}
6752
}
6853
},
6954
karma: {
@@ -107,29 +92,28 @@ module.exports = function (grunt) {
10792
});
10893

10994
grunt.registerTask('banner', function () {
110-
var file = grunt.file.read('dist/js-data-angular.js');
95+
var file = grunt.file.read('./src/index.js');
11196

11297
var banner = '/**\n' +
11398
'* @author Jason Dobry <[email protected]>\n' +
11499
'* @file js-data-angular.js\n' +
115-
'* @version ' + pkg.version + ' - Homepage <http://www.js-data.io/js-data-angular/>\n' +
116-
'* @copyright (c) 2014 Jason Dobry <https://github.com/jmdobry/>\n' +
100+
'* @version ' + pkg.version + ' - Homepage <http://www.js-data.io/docs/js-data-angular/>\n' +
101+
'* @copyright (c) 2014-2015 Jason Dobry <https://github.com/jmdobry/>\n' +
117102
'* @license MIT <https://github.com/js-data/js-data-angular/blob/master/LICENSE>\n' +
118103
'*\n' +
119104
'* @overview Angular wrapper for js-data.js.\n' +
120105
'*/\n';
121106

122107
file = banner + file;
123108

124-
grunt.file.write('dist/js-data-angular.js', file);
109+
grunt.file.write('./dist/js-data-angular.js', file);
125110
});
126111

127112
grunt.registerTask('build', [
128113
'clean',
129114
'jshint',
130-
'browserify',
131115
'banner',
132-
'uglify:main'
116+
'uglify'
133117
]);
134118
grunt.registerTask('go', ['build', 'watch:dist']);
135119
grunt.registerTask('default', ['build']);

dist/js-data-angular.js

+29-20
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,32 @@
11
/**
22
* @author Jason Dobry <[email protected]>
33
* @file js-data-angular.js
4-
* @version 2.2.1 - Homepage <http://www.js-data.io/js-data-angular/>
5-
* @copyright (c) 2014 Jason Dobry <https://github.com/jmdobry/>
4+
* @version 2.2.2 - Homepage <http://www.js-data.io/docs/js-data-angular/>
5+
* @copyright (c) 2014-2015 Jason Dobry <https://github.com/jmdobry/>
66
* @license MIT <https://github.com/js-data/js-data-angular/blob/master/LICENSE>
77
*
88
* @overview Angular wrapper for js-data.js.
99
*/
10-
(function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(require,module,exports){
1110
/*jshint loopfunc:true*/
12-
(function (window, angular, undefined) {
11+
(function (root, factory) {
1312
'use strict';
1413

15-
var JSData;
16-
17-
try {
18-
JSData = require('js-data');
19-
} catch (e) {
20-
21-
}
22-
23-
if (!JSData) {
24-
JSData = window.JSData;
14+
if (typeof define === 'function' && define.amd) {
15+
define(['angular', 'js-data'], function (angular, JSData) {
16+
return factory(root, angular, JSData, undefined);
17+
});
18+
} else if (typeof exports === 'object' && typeof module === 'object') {
19+
module.exports = factory(root, require('angular') || root.angular, require('js-data') || root.JSData, undefined);
20+
} else if (typeof exports === 'object') {
21+
exports.jsDataAngularModuleName = factory(root, require('angular') || root.angular, require('js-data') || root.JSData, undefined);
22+
} else {
23+
root.jsDataAngularModuleName = factory(root, root.angular, root.JSData, undefined);
2524
}
25+
}(this, function (window, angular, JSData, undefined) {
26+
'use strict';
2627

27-
if (!JSData) {
28-
throw new Error('js-data must be loaded!');
28+
if (!JSData || !angular) {
29+
throw new Error('js-data and angular must be loaded!');
2930
}
3031

3132
var DSUtils = JSData.DSUtils;
@@ -358,6 +359,8 @@
358359
var _this = this;
359360
options = options || {};
360361
options.suffix = options.suffix || resourceConfig.suffix;
362+
options.params = options.params || {};
363+
options.params = _this.defaults.queryTransform(resourceConfig, options.params);
361364
return _this.GET(
362365
_this.getPath('find', resourceConfig, id, options),
363366
options
@@ -393,6 +396,8 @@
393396
var _this = this;
394397
options = options || {};
395398
options.suffix = options.suffix || resourceConfig.suffix;
399+
options.params = options.params || {};
400+
options.params = _this.defaults.queryTransform(resourceConfig, options.params);
396401
return _this.POST(
397402
_this.getPath('create', resourceConfig, attrs, options),
398403
(options.serialize ? options.serialize : _this.defaults.serialize)(resourceConfig, attrs),
@@ -406,6 +411,8 @@
406411
var _this = this;
407412
options = options || {};
408413
options.suffix = options.suffix || resourceConfig.suffix;
414+
options.params = options.params || {};
415+
options.params = _this.defaults.queryTransform(resourceConfig, options.params);
409416
return _this.PUT(
410417
_this.getPath('update', resourceConfig, id, options),
411418
(options.serialize ? options.serialize : _this.defaults.serialize)(resourceConfig, attrs),
@@ -438,6 +445,8 @@
438445
var _this = this;
439446
options = options || {};
440447
options.suffix = options.suffix || resourceConfig.suffix;
448+
options.params = options.params || {};
449+
options.params = _this.defaults.queryTransform(resourceConfig, options.params);
441450
return _this.DEL(
442451
_this.getPath('destroy', resourceConfig, id, options),
443452
options
@@ -472,7 +481,7 @@
472481
var _this = this;
473482
var start = new Date();
474483
config = deepMixIn(config, _this.defaults.httpConfig);
475-
if (_this.defaults.forceTrailingSlash && config.url[config.url.length-1] !== '/') {
484+
if (_this.defaults.forceTrailingSlash && config.url[config.url.length - 1] !== '/') {
476485
config.url += '/';
477486
}
478487
config.method = config.method.toUpperCase();
@@ -513,6 +522,6 @@
513522
}]);
514523
}
515524

516-
})(window, window.angular);
517-
518-
},{"js-data":"js-data"}]},{},[1]);
525+
// return the module name
526+
return 'js-data';
527+
}));

0 commit comments

Comments
 (0)