Skip to content

Commit

Permalink
(docs): Document all automatic subscription closing methods
Browse files Browse the repository at this point in the history
  • Loading branch information
Urigo committed May 17, 2015
1 parent 429a0ca commit 92bfa88
Show file tree
Hide file tree
Showing 5 changed files with 43 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .docs/angular-meteor/client/views/api.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ <h2><a href="/api">API</a></h2>
<ul class="nav">
<li><a href="/api/meteorCollection">$meteor.collection</a></li>
<li><a href="/api/AngularMeteorCollection">AngularMeteorCollection</a></li>
<li><a href="/api/AngularMeteorObject">AngularMeteorObject</a></li>
<li><a href="/api/meteorObject">$meteor.object</a></li>
<li><a href="/api/AngularMeteorObject">AngularMeteorObject</a></li>
<li><a href="/api/subscribe">$meteor.subscribe</a></li>
<li><a href="/api/methods">$meteor.call</a></li>
<li><a href="/api/auth">User Authentication</a></li>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,8 @@ <h3><p><code><span class="pln">subscribe( :subscriptionName );</span></code></p>

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

When called after $scope.meteorCollection, it acts the same but in addition it automatically closes the subscription when the scope is destroyed.

#### Parameters

<table class="variables-matrix input-arguments">
Expand Down
34 changes: 34 additions & 0 deletions .docs/angular-meteor/client/views/api/api.AngularMeteorObject.html
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,40 @@ <h3><p><code><span class="pln">reset();</span></code></p></h3>

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

<br>
<h3><p><code><span class="pln">subscribe( :subscriptionName );</span></code></p></h3>
<br>

A shorten (Syntactic sugar) function for the <a href="/api/subscribe">$meteor.subscribe function</a>.

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

When called after $scope.meteorObject, it acts the same but in addition it automatically closes the subscription when the scope is destroyed.

#### Parameters

<table class="variables-matrix input-arguments">
<thead>
<tr>
<th>Param</th>
<th>Type</th>
<th>Details</th>
<th>Required</th>
</tr>
</thead>
<tbody>
<tr>
<td>subscriptionName</td>
<td>
<a href="" class="label type-hint type-hint-string">subscriptionName</a>
</td>
<td><p>The subscription name to subscribe to. exactly like the first parameter in $meteor.subscribe service.
</p></td>
<td><a href="" class="label type-hint type-hint-object">Yes</a></td>
</tr>
</tbody>
</table>

<br>
<h3><p><code><span class="pln">getRawObject();</span></code></p></h3>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@

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

Calling $scope.$meteorCollection will automatically stop the collection when the scope is destroyed.
Calling $scope.$meteorCollection is exactly the same but additionally it will automatically stop the collection when the scope is destroyed.
Therefor this is the recommended method.

----

Expand Down
5 changes: 4 additions & 1 deletion .docs/angular-meteor/client/views/api/api.meteorObject.html
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@
Finds the first document that matches the selector, as ordered by sort and skip options.
Wraps [collection.findOne](http://docs.meteor.com/#/full/findone)

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

----

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

0 comments on commit 92bfa88

Please sign in to comment.