Skip to content

Commit e877f9d

Browse files
committed
tutorial docs cleanup - step_03
1 parent 43dacf7 commit e877f9d

File tree

1 file changed

+15
-15
lines changed

1 file changed

+15
-15
lines changed

.docs/angular-meteor/client/views/steps/tutorial.step_03.html

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -28,16 +28,16 @@ <h1>Step 3 - 3-Way data binding</h1>
2828
So, if we were in any Framework other than Meteor, we would start implementing a series of REST end points to connect the server to the client.
2929
Also, we would need to create a database and functions to connect to it.
3030

31-
And we haven't talked about realtime, so then we need to add sockets, and a local DB for cache and handle latency compensation (or just ignore those features and create a not - so - good and modern app...)
31+
And we haven't talked about realtime, in which case we would need to add sockets, and a local DB for cache and handle latency compensation (or just ignore those features and create a not - so - good and modern app...)
3232

3333
But luckily, we use Meteor!
3434

3535

3636
Meteor makes writing distributed client code as simple as talking to a local database. It's a clean, simple, and secure approach that obviates the need to implement individual RPC endpoints, manually cache data on the client to avoid slow roundtrips to the server, and carefully orchestrate invalidation messages to every client as data changes.
3737

38-
In Meteor, the client and server share the same database API. The same exact application code — like validators and computed properties — can often run in both places. But while code running on the server has direct access to the database, code running on the client does not. This distinction is the basis for Meteor's data security model.
38+
In Meteor, the client and server share the same database API. The exact same application code — like validators and computed properties — can often run in both places. But while code running on the server has direct access to the database, code running on the client does not. This distinction is the basis for Meteor's data security model.
3939

40-
Every Meteor client includes an in-memory database cache. To manage the client cache, the server publishes sets of JSON documents, and the client subscribes to those sets. As documents in a set change, the server patches each client's cache.
40+
Every Meteor client includes an in-memory database cache. To manage the client cache, the server publishes sets of JSON documents, and the client subscribes to these sets. As documents in a set change, the server patches each client's cache.
4141

4242

4343
That introduce us to a new concept - Reactivity.
@@ -60,13 +60,13 @@ <h1>Step 3 - 3-Way data binding</h1>
6060

6161
Now that we've created the collection, our client needs to subscribe to it's changes and bind it to our parties AngularJS collection.
6262

63-
To bind them we are going to use angular-meteor built-in [service](https://docs.angularjs.org/guide/services) called $meteor.collection.
63+
To bind them we are going to use the built-in angular-meteor [service](https://docs.angularjs.org/guide/services) called $meteor.collection.
6464

6565
We are going to replace the declaration of $scope.parties with the following command inside the PartiesListCtrl controller:
6666

6767
$scope.parties = $meteor.collection(Parties);
6868

69-
That line declares a new $scope.parties variable so we don't need to do something like $scope.parties = []; and then bind it to the Parties Mongo collection.
69+
This line declares a new $scope.parties variable so we don't need to do something like $scope.parties = []; and then bind it to the Parties Mongo collection.
7070

7171
We also need to add the $meteor service to the controller with dependency injection.
7272

@@ -89,9 +89,9 @@ <h1>Step 3 - 3-Way data binding</h1>
8989
}
9090

9191

92-
Now every change that will happen to the $scope.parties variable will automatically be saved to the local minimongo and synced to the MongoDB server DB and all the other clients in realtime!
92+
Now every change that happens to the $scope.parties variable will automatically be saved to the local minimongo and synced to the MongoDB server DB and all the other clients in realtime!
9393

94-
But we still don't have information so let's add some.
94+
But we still don't have data in that collection, so let's add some.
9595
Let's initialize our server with the same parties we had before.
9696

9797
Add this to the bottom of app.js:
@@ -116,11 +116,11 @@ <h1>Step 3 - 3-Way data binding</h1>
116116
});
117117
}
118118

119-
As you can probably understand, this code runs only on the server, and when Meteor starts it initialize the DB with sample parties.
119+
As you can probably understand, this code runs only on the server, and when Meteor starts it initializes the DB with these sample parties.
120120

121-
Run the app and see if you see the list of parties on the screen.
121+
Run the app and you should see the list of parties on the screen.
122122

123-
In the next chapter we will see how easy it is to manipulate the data, save and publish the changes to the server and all the connected clients.
123+
In the next chapter we will see how easy it is to manipulate the data, save and publish changes to the server, and by doing so, all the connected clients will automatically get updated.
124124

125125
# Inserting parties from the console
126126

@@ -129,7 +129,7 @@ <h1>Step 3 - 3-Way data binding</h1>
129129

130130
meteor mongo
131131

132-
This opens a console into your app's local development database. Into the prompt, type:
132+
This opens a console into your app's local development database. At the prompt, type:
133133

134134
db.parties.insert({ name: "A new party", description: "From the mongo console!" });
135135

@@ -138,18 +138,18 @@ <h1>Step 3 - 3-Way data binding</h1>
138138

139139
Insert a few more parties from the database console with different text.
140140

141-
Now let's do the same but with remove. Into the prompt, type the following command to look at all the parties and their properties:
141+
Now let's do the same but with remove. At the prompt, type the following command to look at all the parties and their properties:
142142

143143
db.parties.find({});
144144

145145
Now choose one party you want to remove and copy it's id property.
146-
Then, remove it like that (replace N4KzMEvtm4dYvk2TF with your party's id value):
146+
Then, remove it using that id (replace N4KzMEvtm4dYvk2TF with your party's id value):
147147

148148
db.parties.remove( {"_id": "N4KzMEvtm4dYvk2TF"});
149149

150-
Again, you will see the UI of your app immediately update to without the removed party.
150+
Again, you will see the UI of your app immediately update with that party removed.
151151

152-
Try running more actions like update an object from the console and so on..
152+
Try running more actions like updating an object from the console and so on.
153153

154154
In the next step, we'll see how to add functionality to our app's UI so that we can add parties without using the database console.
155155

0 commit comments

Comments
 (0)