Skip to content

Commit 92bfa88

Browse files
committed
(docs): Document all automatic subscription closing methods
1 parent 429a0ca commit 92bfa88

File tree

5 files changed

+43
-3
lines changed

5 files changed

+43
-3
lines changed

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ <h2><a href="/api">API</a></h2>
66
<ul class="nav">
77
<li><a href="/api/meteorCollection">$meteor.collection</a></li>
88
<li><a href="/api/AngularMeteorCollection">AngularMeteorCollection</a></li>
9-
<li><a href="/api/AngularMeteorObject">AngularMeteorObject</a></li>
109
<li><a href="/api/meteorObject">$meteor.object</a></li>
10+
<li><a href="/api/AngularMeteorObject">AngularMeteorObject</a></li>
1111
<li><a href="/api/subscribe">$meteor.subscribe</a></li>
1212
<li><a href="/api/methods">$meteor.call</a></li>
1313
<li><a href="/api/auth">User Authentication</a></li>

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

+2
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,8 @@ <h3><p><code><span class="pln">subscribe( :subscriptionName );</span></code></p>
9595

9696
Takes only one parameter and not returns a promise like <a href="/api/subscribe">$meteor.subscribe</a> does.
9797

98+
When called after $scope.meteorCollection, it acts the same but in addition it automatically closes the subscription when the scope is destroyed.
99+
98100
#### Parameters
99101

100102
<table class="variables-matrix input-arguments">

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

+34
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,40 @@ <h3><p><code><span class="pln">reset();</span></code></p></h3>
6161

6262
Reset the current value of the object to the one in the server.
6363

64+
<br>
65+
<h3><p><code><span class="pln">subscribe( :subscriptionName );</span></code></p></h3>
66+
<br>
67+
68+
A shorten (Syntactic sugar) function for the <a href="/api/subscribe">$meteor.subscribe function</a>.
69+
70+
Takes only one parameter and not returns a promise like <a href="/api/subscribe">$meteor.subscribe</a> does.
71+
72+
When called after $scope.meteorObject, it acts the same but in addition it automatically closes the subscription when the scope is destroyed.
73+
74+
#### Parameters
75+
76+
<table class="variables-matrix input-arguments">
77+
<thead>
78+
<tr>
79+
<th>Param</th>
80+
<th>Type</th>
81+
<th>Details</th>
82+
<th>Required</th>
83+
</tr>
84+
</thead>
85+
<tbody>
86+
<tr>
87+
<td>subscriptionName</td>
88+
<td>
89+
<a href="" class="label type-hint type-hint-string">subscriptionName</a>
90+
</td>
91+
<td><p>The subscription name to subscribe to. exactly like the first parameter in $meteor.subscribe service.
92+
</p></td>
93+
<td><a href="" class="label type-hint type-hint-object">Yes</a></td>
94+
</tr>
95+
</tbody>
96+
</table>
97+
6498
<br>
6599
<h3><p><code><span class="pln">getRawObject();</span></code></p></h3>
66100

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

+2-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@
1212

1313
A service that wraps the [Meteor collections](http://docs.meteor.com/#/full/collections) to enable reactivity within AngularJS.
1414

15-
Calling $scope.$meteorCollection will automatically stop the collection when the scope is destroyed.
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.
1617

1718
----
1819

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

+4-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,8 @@
1414
Finds the first document that matches the selector, as ordered by sort and skip options.
1515
Wraps [collection.findOne](http://docs.meteor.com/#/full/findone)
1616

17-
Calling $scope.$meteorObject will automatically stop the object when the scope is destroyed.
17+
Calling $scope.$meteorObject is exactly the same but additionally it will automatically stop the object when the scope is destroyed.
18+
Therefor this is the recommended method.
1819

1920
----
2021

@@ -80,6 +81,8 @@
8081
<li><code><span class="pln">save</span></code> — saves the current value of the object to the server.
8182
returns a promise with an error in case for an error or a number of successful docs changed in case of success.</li>
8283
<li><code><span class="pln">reset</span></code> — reset the current value of the object to the one in the server.</li>
84+
<li><code><span class="pln">subscribe</span></code><a href="/api/AngularMeteorObject">Go to reference</a></li>
85+
<li><code><span class="pln">getRawObject</span></code><a href="/api/AngularMeteorObject">Go to reference</a></li>
8386
</ul>
8487
</td>
8588
</tr>

0 commit comments

Comments
 (0)