Skip to content

Commit bc9e730

Browse files
committed
Update tutorials.socially.angular2.step_07.md
Small grammar improvements to help the flow of the tutorial.
1 parent 51cb0c9 commit bc9e730

File tree

1 file changed

+17
-17
lines changed

1 file changed

+17
-17
lines changed

docs/angular-meteor/client/content/tutorials/socially/angular2/tutorials.socially.angular2.step_07.md

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,43 +1,43 @@
11
{{#template name="tutorials.socially.angular2.step_07.md"}}
22
{{> downloadPreviousStep stepName="step_06"}}
33

4-
In this step we will review briefly files structure our Socially app has so far,
5-
also we’ll look closely into TypeScript features since knowing better primary programming language of this package would be surely beneficial.
4+
In this step we will briefly review the file structure our Socially app has so far,
5+
also we’ll look closely into certain TypeScript features since having a better understanding of the primary programming language of this package would be surely beneficial.
66

77
# File Structure
88

9-
As you probably have noticed, our tutorial app has a strict modular structure at this point:
10-
there is no pure JavaScript files that are being bundled together and auto-executed, so Meteor's file loading conventions don't have effect.
9+
As you have probably noticed, our tutorial app has a strict modular structure at this point:
10+
there are no pure JavaScript files that are being bundled together and auto-executed, so Meteor's file loading conventions doesn't have an effect.
1111
Even more, every .ts-file is being compiled into a separate System.j module, which we can then import whenever we need to.
1212

13-
There is another one thing worth sounding once more. As you know, Meteor has two special folders: **client** and **server** .
14-
We can benefit from them (and already done it in this app) too by allowing access to the client side modules from the client side only and, accordingly, to server side modules from the server side.
15-
Everything outside them will be available to the both parts.
16-
It’s, no wonder, a recommended approach in Meteor, and this is how we’ve been doing it so far.
13+
There is another thing worth mentioning once more. As you know, Meteor has two special folders: **client** and **server**.
14+
We can benefit from them (and have already done so in this app) by allowing access to the client side modules from the client side only and, accordingly, to server side modules from the server side.
15+
Everything outside of those folders will be available to the both client and server.
16+
It’s no wonder why this is a recommended approach in Meteor, and this is why we’ve been doing it so far.
1717
Let's stick to it further.
1818

1919
# TypeScript
2020

2121
TypeScript is a rather new language that has been around for 3 years only.
22-
Since then it’s been gaining [popularity](https://www.google.com/trends/explore#q=%2Fm%2F0n50hxv) due to various reasons. Among them are one of the fullest implementation of the ES2015 standard's features
23-
on the market including some of the experimental ones, pseudo type-checking and rich toolset developed by Microsoft and TypeScript community.
22+
Since then it’s been gaining [popularity](https://www.google.com/trends/explore#q=%2Fm%2F0n50hxv) due to various reasons. Among them is one of the fullest implementations of ES2015 features
23+
on the market: including some of the experimental ones, pseudo type-checking and a rich toolset developed by Microsoft and the TypeScript community.
2424
It has support already in all major IDEs including Visual Studio, WebStorm, Sublime etc.
2525

2626
One of the hottest questions in JavaScript, that has been around since the Web 2.0 era started, was how to make JavaScript less bug-prone and
2727
suitable for big projects. In the OOP world, well-known solutions include modularity and strict type-checking. While OOP is available in JavaScript in some way,
2828
it turned out to be very hard to create a good type-checking due to, first of all, JavaScript's flexibility. One always needs to impose a certain number of rules to
2929
follow to make a JavaScript compiler effective. For many years, we’ve seen around a number of solutions including Closure Compiler and GWT from Google, a bunch of C#-to-JavaScript compilers and others.
3030

31-
This was, for sure, one of the questions why TypeScript team were striving to solve: to create a language that would inherit flexibility of JavaScript while would have, at the same, effective type-checking with minimum amount of effort required from the user. There should have been some kind of the [middle way](https://en.wikipedia.org/wiki/Middle_Way).
32-
And they found it, having introduced the type declaration files. These are files of special kind where you describe interfaces your classes expose along with signatures of the methods and types of the parameters they take, so that TypeScript will be able to refer to these files to verify correctness of your class's API.
33-
Of course, flexibility is still there which means if you don’t want to declare types you can skip them right away.
31+
This was, for sure, one of the problems the TypeScript team were striving to solve: to create a language that would inherit the flexibility of JavaScript while, at the same time, having effective type-checking with minimum effort required from the user. There should have been some kind of [middle way](https://en.wikipedia.org/wiki/Middle_Way).
32+
And they found it, having introduced the type declaration files. These are files of a special kind where you describe interfaces your classes expose along with signatures of the methods and types of the parameters they take, so that TypeScript will be able to refer to these files to verify the correctness of your class's API.
33+
Of course, the flexibility is still there which means if you don’t want to declare types you can skip them right away.
3434

35-
Usage of the declaration files was mentioned multiple time in this tutorial before with the `/// <reference path=".." />` syntax. By this way, we tell TypeScript what declaration files to check when it is compiling a particular .ts-file.
35+
Usage of the declaration files was mentioned multiple times in this tutorial with the `/// <reference path=".." />` syntax. By this way, we tell TypeScript what declaration files to check when it is compiling a particular .ts-file.
3636

3737
As you may have noticed, Angular2-Meteor package itself installs a number of these files into the **typings** folder.
3838
Some of them have names `angular2.d.ts` and `meteor.d.ts`, which, as you can guess, are used to verify that API of Meteor and Angular 2 are being used correctly in your code.
3939

40-
But let’s create own declaration file to learn this type-checking better.
40+
But let’s create our own declaration file in order to learn this type-checking better.
4141
Keep in mind, type-checking is not delivered in the outputted JavaScript. It is only extra sugar for your development environment, and adds no weight to the outputted .js file.
4242

4343
## Type Declaration Files
@@ -49,7 +49,7 @@ Let's create `party.d.ts` file and place it inside “typings” folder with the
4949

5050
{{> DiffBox tutorialName="meteor-angular2-socially" step="7.1"}}
5151

52-
One of the places where declared type can be used is a definition of the parties collection in `collections/parties.ts`.
52+
One of the places where the declared type can be used is in the definition of the parties collection in `collections/parties.ts`.
5353
Let’s change the code to:
5454

5555
{{> DiffBox tutorialName="meteor-angular2-socially" step="7.2"}}
@@ -69,7 +69,7 @@ There you’ll see the `parties` property assigned to the `Mongo.Cursor<Object>`
6969
But let’s change it to `Mongo.Cursor<string>`. Run the app and you will see it’s swearing again.
7070
TypeScript doesn’t know how to convert `Mongo.Cursor<string>` to `Mongo.Cursor<Party>`, so it considers the assigment to be wrong.
7171

72-
Isn’t cool?! We’ve made our app to be bug persistent with only few changes!
72+
Isn’t it cool?! We’ve made our app to be bug persistent with only few changes!
7373

7474
Finally, let’s change `Object` to `Party` in the `parties-list.ts` and `party-details.ts` files to make our code look right:
7575

0 commit comments

Comments
 (0)