-
Notifications
You must be signed in to change notification settings - Fork 77
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
12 changed files
with
68 additions
and
75 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,7 +2,7 @@ | |
* js-data-angular | ||
* http://github.com/js-data/js-data-angular | ||
* | ||
* Copyright (c) 2014 Jason Dobry <http://www.js-data.io/js-data-angular> | ||
* Copyright (c) 2014-2015 Jason Dobry <http://www.js-data.io/docs/js-data-angular> | ||
* Licensed under the MIT license. <https://github.com/js-data/js-data-angular/blob/master/LICENSE> | ||
*/ | ||
module.exports = function (grunt) { | ||
|
@@ -40,7 +40,7 @@ module.exports = function (grunt) { | |
'* @author Jason Dobry <[email protected]>\n' + | ||
'* @file js-data-angular.min.js\n' + | ||
'* @version <%= pkg.version %> - Homepage <https://www.js-data.io/js-data-angular/>\n' + | ||
'* @copyright (c) 2014 Jason Dobry <https://github.com/jmdobry/>\n' + | ||
'* @copyright (c) 2014-2015 Jason Dobry <https://github.com/jmdobry/>\n' + | ||
'* @license MIT <https://github.com/js-data/js-data-angular/blob/master/LICENSE>\n' + | ||
'*\n' + | ||
'* @overview Angular wrapper for js-data.\n' + | ||
|
@@ -49,21 +49,6 @@ module.exports = function (grunt) { | |
files: { | ||
'dist/js-data-angular.min.js': ['dist/js-data-angular.js'] | ||
} | ||
}, | ||
scripts: { | ||
files: { | ||
'doc/resources/js/libs.min.js': ['doc/resources/js/libs.js'] | ||
} | ||
} | ||
}, | ||
browserify: { | ||
options: { | ||
external: ['js-data'] | ||
}, | ||
dist: { | ||
files: { | ||
'dist/js-data-angular.js': ['src/index.js'] | ||
} | ||
} | ||
}, | ||
karma: { | ||
|
@@ -107,29 +92,28 @@ module.exports = function (grunt) { | |
}); | ||
|
||
grunt.registerTask('banner', function () { | ||
var file = grunt.file.read('dist/js-data-angular.js'); | ||
var file = grunt.file.read('./src/index.js'); | ||
|
||
var banner = '/**\n' + | ||
'* @author Jason Dobry <[email protected]>\n' + | ||
'* @file js-data-angular.js\n' + | ||
'* @version ' + pkg.version + ' - Homepage <http://www.js-data.io/js-data-angular/>\n' + | ||
'* @copyright (c) 2014 Jason Dobry <https://github.com/jmdobry/>\n' + | ||
'* @version ' + pkg.version + ' - Homepage <http://www.js-data.io/docs/js-data-angular/>\n' + | ||
'* @copyright (c) 2014-2015 Jason Dobry <https://github.com/jmdobry/>\n' + | ||
'* @license MIT <https://github.com/js-data/js-data-angular/blob/master/LICENSE>\n' + | ||
'*\n' + | ||
'* @overview Angular wrapper for js-data.js.\n' + | ||
'*/\n'; | ||
|
||
file = banner + file; | ||
|
||
grunt.file.write('dist/js-data-angular.js', file); | ||
grunt.file.write('./dist/js-data-angular.js', file); | ||
}); | ||
|
||
grunt.registerTask('build', [ | ||
'clean', | ||
'jshint', | ||
'browserify', | ||
'banner', | ||
'uglify:main' | ||
'uglify' | ||
]); | ||
grunt.registerTask('go', ['build', 'watch:dist']); | ||
grunt.registerTask('default', ['build']); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,31 +1,32 @@ | ||
/** | ||
* @author Jason Dobry <[email protected]> | ||
* @file js-data-angular.js | ||
* @version 2.2.1 - Homepage <http://www.js-data.io/js-data-angular/> | ||
* @copyright (c) 2014 Jason Dobry <https://github.com/jmdobry/> | ||
* @version 2.2.2 - Homepage <http://www.js-data.io/docs/js-data-angular/> | ||
* @copyright (c) 2014-2015 Jason Dobry <https://github.com/jmdobry/> | ||
* @license MIT <https://github.com/js-data/js-data-angular/blob/master/LICENSE> | ||
* | ||
* @overview Angular wrapper for js-data.js. | ||
*/ | ||
(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){ | ||
/*jshint loopfunc:true*/ | ||
(function (window, angular, undefined) { | ||
(function (root, factory) { | ||
'use strict'; | ||
|
||
var JSData; | ||
|
||
try { | ||
JSData = require('js-data'); | ||
} catch (e) { | ||
|
||
} | ||
|
||
if (!JSData) { | ||
JSData = window.JSData; | ||
if (typeof define === 'function' && define.amd) { | ||
define(['angular', 'js-data'], function (angular, JSData) { | ||
return factory(root, angular, JSData, undefined); | ||
}); | ||
} else if (typeof exports === 'object' && typeof module === 'object') { | ||
module.exports = factory(root, require('angular') || root.angular, require('js-data') || root.JSData, undefined); | ||
} else if (typeof exports === 'object') { | ||
exports.jsDataAngularModuleName = factory(root, require('angular') || root.angular, require('js-data') || root.JSData, undefined); | ||
} else { | ||
root.jsDataAngularModuleName = factory(root, root.angular, root.JSData, undefined); | ||
} | ||
}(this, function (window, angular, JSData, undefined) { | ||
'use strict'; | ||
|
||
if (!JSData) { | ||
throw new Error('js-data must be loaded!'); | ||
if (!JSData || !angular) { | ||
throw new Error('js-data and angular must be loaded!'); | ||
} | ||
|
||
var DSUtils = JSData.DSUtils; | ||
|
@@ -358,6 +359,8 @@ | |
var _this = this; | ||
options = options || {}; | ||
options.suffix = options.suffix || resourceConfig.suffix; | ||
options.params = options.params || {}; | ||
options.params = _this.defaults.queryTransform(resourceConfig, options.params); | ||
return _this.GET( | ||
_this.getPath('find', resourceConfig, id, options), | ||
options | ||
|
@@ -393,6 +396,8 @@ | |
var _this = this; | ||
options = options || {}; | ||
options.suffix = options.suffix || resourceConfig.suffix; | ||
options.params = options.params || {}; | ||
options.params = _this.defaults.queryTransform(resourceConfig, options.params); | ||
return _this.POST( | ||
_this.getPath('create', resourceConfig, attrs, options), | ||
(options.serialize ? options.serialize : _this.defaults.serialize)(resourceConfig, attrs), | ||
|
@@ -406,6 +411,8 @@ | |
var _this = this; | ||
options = options || {}; | ||
options.suffix = options.suffix || resourceConfig.suffix; | ||
options.params = options.params || {}; | ||
options.params = _this.defaults.queryTransform(resourceConfig, options.params); | ||
return _this.PUT( | ||
_this.getPath('update', resourceConfig, id, options), | ||
(options.serialize ? options.serialize : _this.defaults.serialize)(resourceConfig, attrs), | ||
|
@@ -438,6 +445,8 @@ | |
var _this = this; | ||
options = options || {}; | ||
options.suffix = options.suffix || resourceConfig.suffix; | ||
options.params = options.params || {}; | ||
options.params = _this.defaults.queryTransform(resourceConfig, options.params); | ||
return _this.DEL( | ||
_this.getPath('destroy', resourceConfig, id, options), | ||
options | ||
|
@@ -472,7 +481,7 @@ | |
var _this = this; | ||
var start = new Date(); | ||
config = deepMixIn(config, _this.defaults.httpConfig); | ||
if (_this.defaults.forceTrailingSlash && config.url[config.url.length-1] !== '/') { | ||
if (_this.defaults.forceTrailingSlash && config.url[config.url.length - 1] !== '/') { | ||
config.url += '/'; | ||
} | ||
config.method = config.method.toUpperCase(); | ||
|
@@ -513,6 +522,6 @@ | |
}]); | ||
} | ||
|
||
})(window, window.angular); | ||
|
||
},{"js-data":"js-data"}]},{},[1]); | ||
// return the module name | ||
return 'js-data'; | ||
})); |
Oops, something went wrong.