|
11 | 11 | # $meteor.collection / $scope.$meteorCollection
|
12 | 12 |
|
13 | 13 | A service that wraps the [Meteor collections](http://docs.meteor.com/#/full/collections) to enable reactivity within AngularJS.
|
| 14 | +This service binds between the angularjs $scope variables and the meteor collection. Service binding include 3 parts: |
| 15 | +- watching the changes in angular $scope and updating the meteor collection. (called "autobind") |
| 16 | +- watching hte changes in the meteor collection and updating the angular $scope varialbles (called "observe"). |
14 | 17 |
|
15 |
| -Calling $scope.$meteorCollection is exactly the same but additionally it will automatically stop the collection when the scope is destroyed. |
16 |
| -Therefor this is the recommended method. |
| 18 | +The autobinding is optional, and can be set to false, so changes in the angular $scope varialbles will have to be explictly saved to the collection to be updated to the meteor collection. |
| 19 | +The AngularMeteor collection can be explicitly stopped by calling the stop() function. It important to stop the collection to avoid the increase in number of watchers. |
| 20 | +Calling $scope.$meteorCollection does the same but will also stop the collection when the scope is destroyed. |
| 21 | +Therefore this is the recommended method. |
17 | 22 |
|
18 | 23 | ----
|
19 | 24 |
|
20 | 25 | ## Usage
|
21 | 26 |
|
22 |
| - $meteor.collection(collection, auto) |
| 27 | + $meteor.collection(collection, autobind) |
23 | 28 |
|
24 |
| - $scope.$meteorCollection(collection, auto) |
| 29 | + $scope.$meteorCollection(collection, autobind) |
25 | 30 |
|
26 | 31 | ### Arguments
|
27 | 32 |
|
|
73 | 78 | <table class="variables-matrix return-arguments">
|
74 | 79 | <tbody><tr>
|
75 | 80 | <td><a href="" class="label type-hint type-hint-object">object</a></td>
|
76 |
| - <td><p>Newly created <a href="/api/AngularMeteorCollection">AngularMeteorCollection</a> object with the following set of methods:</p> |
77 |
| - <ul> |
78 |
| - <li><code><span class="pln">save</span></code> — <a href="/api/AngularMeteorCollection">Go to reference</a></li> |
79 |
| - <li><code><span class="pln">remove</span></code> — <a href="/api/AngularMeteorCollection">Go to reference</a></li> |
80 |
| - <li><code><span class="pln">subscribe</span></code> — <a href="/api/AngularMeteorCollection">Go to reference</a></li> |
81 |
| - </ul> |
| 81 | + <td><p>Newly created <a href="/api/AngularMeteorCollection">AngularMeteorCollection</a> object. |
82 | 82 | </td>
|
83 | 83 | </tr>
|
84 | 84 | </tbody></table>
|
|
170 | 170 |
|
171 | 171 | }
|
172 | 172 |
|
| 173 | + |
173 | 174 | {{/markdown}}
|
174 | 175 | </do-nothing>
|
175 | 176 |
|
|
0 commit comments