Skip to content

Commit 26401e4

Browse files
committed
API updated
added explanation about stopping
1 parent 09a66cb commit 26401e4

File tree

1 file changed

+11
-10
lines changed

1 file changed

+11
-10
lines changed

.docs/angular-meteor/client/views/api/api.meteorCollection.html

+11-10
Original file line numberDiff line numberDiff line change
@@ -11,17 +11,22 @@
1111
# $meteor.collection / $scope.$meteorCollection
1212

1313
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").
1417

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.
1722

1823
----
1924

2025
## Usage
2126

22-
$meteor.collection(collection, auto)
27+
$meteor.collection(collection, autobind)
2328

24-
$scope.$meteorCollection(collection, auto)
29+
$scope.$meteorCollection(collection, autobind)
2530

2631
### Arguments
2732

@@ -73,12 +78,7 @@
7378
<table class="variables-matrix return-arguments">
7479
<tbody><tr>
7580
<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.
8282
</td>
8383
</tr>
8484
</tbody></table>
@@ -170,6 +170,7 @@
170170

171171
}
172172

173+
173174
{{/markdown}}
174175
</do-nothing>
175176

0 commit comments

Comments
 (0)