Skip to content

Commit b402932

Browse files
committed
Update README.md: Added "Back to top" link above h3.
1 parent 58a2cc1 commit b402932

File tree

1 file changed

+19
-2
lines changed

1 file changed

+19
-2
lines changed

README.md

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -165,8 +165,6 @@ Each time, there're more Production WebApps using `Restangular`. If your webapp
165165

166166
#Starter Guide
167167

168-
**[Back to top](#table-of-contents)**
169-
170168
## Quick Configuration (For Lazy Readers)
171169
This is all you need to start using all the basic Restangular features.
172170

@@ -205,6 +203,8 @@ Restangular.one('accounts', 1234)
205203
Restangular.several('accounts', 1234, 123, 12345);
206204
````
207205

206+
**[Back to top](#table-of-contents)**
207+
208208
### Let's code!
209209

210210
Now that we have our main Object let's start playing with it.
@@ -551,6 +551,8 @@ You can set this to either `true` or `false`. By default it's false. If set to t
551551

552552
You can set here if you want to URL Encode IDs or not. By default, it's true.
553553

554+
**[Back to top](#table-of-contents)**
555+
554556
### Accessing configuration
555557

556558
You can also access the configuration via `RestangularProvider` and `Restangular` via the `configuration` property if you don't want to use the setters. Check it out:
@@ -559,6 +561,8 @@ You can also access the configuration via `RestangularProvider` and `Restangular
559561
Restangular.configuration.requestSuffix = '/';
560562
````
561563

564+
**[Back to top](#table-of-contents)**
565+
562566
### How to configure them globally
563567

564568
You can configure this in either the `config` or the `run` method. If your configurations don't need any other services, then I'd recommend you do them in the `config`. If your configurations depend on other services, you can configure them in the `run` using `Restangular` instead of `RestangularProvider`
@@ -621,6 +625,8 @@ app.run(function(Restangular, BaseUrlCalculator) {
621625
});
622626
````
623627

628+
**[Back to top](#table-of-contents)**
629+
624630
### How to create a Restangular service with a different configuration from the global one
625631
Let's assume that for most requests you need some configuration (The global one), and for just a bunch of methods you need another configuration. In that case, you'll need to create another Restangular service with this particular configuration. This scoped configuration will inherit all defaults from the global one. Let's see how.
626632

@@ -651,6 +657,8 @@ app.controller('MainCtrl', function(Restangular, BingRestangular) {
651657
});
652658
````
653659

660+
**[Back to top](#table-of-contents)**
661+
654662
### Decoupled Restangular Service
655663

656664
There're some times where you want to use Restangular but you don't want to expose Restangular object anywhere. For those cases, you can actually use the `service` feature of Restangular.
@@ -700,6 +708,7 @@ These are the methods that can be called on the Restangular object.
700708
* **restangularizeElement(parent, element, route, queryParams)**: Restangularizes a new element
701709
* **restangularizeCollection(parent, element, route, queryParams)**: Restangularizes a new collection
702710

711+
**[Back to top](#table-of-contents)**
703712

704713
### Element methods
705714
* **get([queryParams, headers])**: Gets the element. Query params and headers are optionals
@@ -724,6 +733,8 @@ These are the methods that can be called on the Restangular object.
724733
* **withHttpConfig(httpConfig)**: It lets you set a configuration for $http only for the next call. Check the Local Config HTTP section for an example.
725734
* **save**: Calling save will determine whether to do PUT or POST accordingly
726735

736+
**[Back to top](#table-of-contents)**
737+
727738
### Collection methods
728739
* **getList([queryParams, headers]): Gets itself again (Remember this is a collection)**.
729740
* **get([id]): Gets one item from the collection by id**.
@@ -744,6 +755,8 @@ These are the methods that can be called on the Restangular object.
744755
* **clone()**: Copies the collection
745756
* **withHttpConfig(httpConfig)**: It lets you set a configuration for $http only for the next call. Check the Local Config HTTP section for an example.
746757

758+
**[Back to top](#table-of-contents)**
759+
747760
### Custom methods
748761
* **customGET(path, [params, headers])**: Does a GET to the specific path. Optionally you can set params and headers.
749762
* **customGETLIST(path, [params, headers])**: Does a GET to the specific path. **In this case, you expect to get an array, not a single element**. Optionally you can set params and headers.
@@ -1010,6 +1023,8 @@ Create custom methods for your models using Restangular.extendModel(). This is a
10101023
Restangular.addElementTransformer(route, false, fn);
10111024
```
10121025

1026+
**[Back to top](#table-of-contents)**
1027+
10131028
### Example:
10141029
```js
10151030
Restangular.extendModel('accounts', function(model) {
@@ -1289,3 +1304,5 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
12891304

12901305

12911306
[![Bitdeli Badge](https://d2weczhvl823v0.cloudfront.net/mgonto/restangular/trend.png)](https://bitdeli.com/free "Bitdeli Badge")
1307+
1308+
**[Back to top](#table-of-contents)**

0 commit comments

Comments
 (0)