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
Copy file name to clipboardExpand all lines: docs/guides/integration.md
+10-10Lines changed: 10 additions & 10 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -20,7 +20,7 @@ The primary key is just a model configuration property and by default is set to
20
20
To change it for a particular model use the configuration property:
21
21
22
22
```javascript
23
-
restmod.model('/bikes', {
23
+
restmod.model('/bikes').$mix({
24
24
PRIMARY_KEY:'_id'
25
25
});
26
26
```
@@ -81,10 +81,10 @@ Will expect:
81
81
}
82
82
```
83
83
84
-
The resoure's name is extracted from the resource url, if no url is given (anonymous resource) or if url does not match the resource's name, then you can change it's name and plural name by setting the `NAME` and `PLURAL` configuration variables:
84
+
The resoure's name is extracted from the resource url, if no url is given (nested resource) or if url does not match the resource's name, then you can change it's name and plural name by setting the `NAME` and `PLURAL` configuration variables:
85
85
86
86
```javascript
87
-
restmod.model(null, function() {
87
+
restmod.model().$mix(function() {
88
88
NAME:'mouse', // if you only set NAME, then plural is infered from it using the inflector.
89
89
PLURAL:'mice'
90
90
});
@@ -128,7 +128,7 @@ To change the property from where the packer extracts the metadata set the `JSON
128
128
```
129
129
130
130
```javascript
131
-
var Bike =restmod.model('/api/bikes', {
131
+
var Bike =restmod.model('/api/bikes').$mix({
132
132
PACKER:'default',
133
133
JSON_META:'.'
134
134
});
@@ -176,10 +176,10 @@ var Base = restmod.mixin({
176
176
PACKER: 'default' // remember to enable the default packer.
177
177
});
178
178
179
-
var User = restmod.model('/api/users', Base);
180
-
var Part = restmod.model('/api/parts', Base);
179
+
var User = restmod.model('/api/users').$mix(Base);
180
+
var Part = restmod.model('/api/parts').$mix(Base);
181
181
182
-
var Bike = restmod.model('/api/bikes', Base, {
182
+
var Bike = restmod.model('/api/bikes').$mix(Base, {
Take a look at the default naming stardards, inlined resources are expected to use the **pluralized** names for their respective model names. See. By default the name is extracted from the url, you can change a model's name and plural name by setting the `NAME` and `PLURAL` configuration variables:
204
204
205
205
```javascript
206
-
restmod.model(null, function() {
206
+
restmod.model().$mix(function() {
207
207
NAME:'mouse', // if you only set NAME, then plural is infered from it.
208
208
PLURAL:'mice'
209
209
});
@@ -256,7 +256,7 @@ To handle API's that require '$' prefixed properies you have two posibilities:
256
256
2. if there are only a couple of properties you need to let through, assign a special mapping to those properties:
To see available styles checkout the [Style listing](https://github.com/platanus/angular-restmod/blob/master/docs/guides/styles.md).
332
+
To see available styles or colaborate with a new one, take a look at the [Style listing](https://github.com/platanus/angular-restmod/blob/master/docs/guides/styles.md).
0 commit comments