Skip to content

Commit d8dec59

Browse files
committed
Added some missing documentation. #124.
1 parent e8f77e7 commit d8dec59

File tree

1 file changed

+27
-2
lines changed

1 file changed

+27
-2
lines changed

dist/angular-data.js

+27-2
Original file line numberDiff line numberDiff line change
@@ -1872,7 +1872,7 @@ function DSHttpAdapterProvider() {
18721872
module.exports = DSHttpAdapterProvider;
18731873

18741874
},{}],37:[function(require,module,exports){
1875-
/**
1875+
/*!
18761876
* @doc function
18771877
* @id DSLocalStorageAdapterProvider
18781878
* @name DSLocalStorageAdapterProvider
@@ -2021,6 +2021,31 @@ function DSLocalStorageAdapterProvider() {
20212021
* @name create
20222022
* @description
20232023
* Create an entity in `localStorage`. You must generate the primary key and include it in the `attrs` object.
2024+
*
2025+
* ## Signature:
2026+
* ```js
2027+
* DSLocalStorageAdapter.create(resourceConfig, attrs[, options])
2028+
* ```
2029+
*
2030+
* ## Example:
2031+
* ```js
2032+
* DS.create('user', {
2033+
* id: 1,
2034+
* name: 'john'
2035+
* }, {
2036+
* adapter: 'DSLocalStorageAdapter'
2037+
* }).then(function (user) {
2038+
* user; // { id: 1, name: 'john' }
2039+
* });
2040+
* ```
2041+
*
2042+
* @param {object} resourceConfig DS resource definition object:
2043+
* @param {object} attrs Attributes to create in localStorage.
2044+
* @param {object=} options Optional configuration. Properties:
2045+
*
2046+
* - `{string=}` - `baseUrl` - Base path to use.
2047+
*
2048+
* @returns {Promise} Promise.
20242049
*/
20252050
create: function (resourceConfig, attrs, options) {
20262051
if (!(resourceConfig.idAttribute in attrs)) {
@@ -2048,7 +2073,7 @@ function DSLocalStorageAdapterProvider() {
20482073
* ## Example:
20492074
* ```js
20502075
* DS.update('user', 5, {
2051-
* name: ''
2076+
* name: 'john'
20522077
* }, {
20532078
* adapter: 'DSLocalStorageAdapter'
20542079
* }).then(function (user) {

0 commit comments

Comments
 (0)