You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: .docs/angular-meteor/client/views/angular-2.html
+1-1Lines changed: 1 addition & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -165,7 +165,7 @@ <h4 class="sample-code">
165
165
<divclass="angular-2-option">
166
166
<h2>Angular 2.0.0-alpha</h2>
167
167
<p>
168
-
An angualr2-meteor package with all the dependencies (TypeScript, System.js, etc...) so you can start writing Angular 2.0 code right away. written by - <ahref="https://github.com/netanelgilad"><iclass="fa fa-github"></i> @netanelgilad</a>.
168
+
An angular2-meteor package with all the dependencies (TypeScript, System.js, etc...) so you can start writing Angular 2.0 code right away. written by - <ahref="https://github.com/netanelgilad"><iclass="fa fa-github"></i> @netanelgilad</a>.
Copy file name to clipboardExpand all lines: .docs/angular-meteor/client/views/steps/tutorial.intro.html
+1-1Lines changed: 1 addition & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -20,7 +20,7 @@
20
20
21
21
No previous knowledge in Angular or Meteor is necessary.
22
22
23
-
We will walk you through building an Angular-Meteor app. Can't wait to see it? Here's the final version - [http://socially-step18.meteor.com/](http://socially-step18.meteor.com/). Don't forget to come back an go through this tutorial!
23
+
We will walk you through building an Angular-Meteor app. Can't wait to see it? Here's the final version - [http://socially-step18.meteor.com/](http://socially-step18.meteor.com/). Don't forget to come back and go through this tutorial!
24
24
25
25
You can also participate in our free angular-meteor university and do the step by step exercises together with community members.
26
26
Read more about the angular-meteor university [here](https://github.com/Urigo/meteor-angular-socially#angular-meteor-university-).
Copy file name to clipboardExpand all lines: .docs/angular-meteor/client/views/steps/tutorial.step_00.html
+20-21Lines changed: 20 additions & 21 deletions
Original file line number
Diff line number
Diff line change
@@ -55,7 +55,7 @@ <h1>Step 0 - Bootstrapping</h1>
55
55
56
56
So, as you can see, we have a full running app! which includes a server and a client.
57
57
58
-
But let's start from the beginning, please delete the following files:
58
+
The default Meteor app starts life with three files, one 'js', one 'html' and one 'css' file. Each named with the application name you used in the 'create' command above, in our case this is 'socially'. We're going to add our own files for this tutorial. So let's start by deleting the following files:
59
59
60
60
socially.css socially.html socially.js
61
61
@@ -72,7 +72,7 @@ <h1>Step 0 - Bootstrapping</h1>
72
72
As you can see, there is no html tag, no head tag, very simple.
73
73
74
74
75
-
The reason is the way Meteor structures and serves files to the client.
75
+
The reason for this is the way Meteor structures and serves files to the client.
76
76
77
77
Meteor scans all the HTML files in your application and concatenates them together.
But if you load this in your browser, you'll see nothing. That's because we still need to create the actual Angular app, which we'll do next.
123
+
But if you load this in your browser, you won't see anything. That's because we still need to create the actual Angular app, which we'll do next.
124
124
125
-
* It's very important to note - all the paths are always absolute, not relative! so if 'index.ng.html' was inside a client folder, you would have to place the whole path from the route app, doesn't matter where you are
126
-
calling the file from, like that:
125
+
* It's very important to note - the paths are always absolute, not relative! so if 'index.ng.html' was inside a client folder, you would have to place the whole path from the route app, doesn't matter where you're calling the file from.
126
+
127
+
like this (e.g. if index.ng.html was in the 'client' folder):
127
128
128
129
<divng-include="'client/index.ng.html'"></div>
129
130
130
131
# AngularJS app
131
132
132
-
AngularJS apps are actually individual modules so now we are going to create our app module.
133
+
AngularJS apps are actually individual modules. So to start with lets create our app module.
133
134
134
-
Create a new app.js file. now you can see another example of Meteor's power and simplicity - no need to include this file anywhere. Meteor will take care of it by going through all the files in the folder and including them automatically.
135
+
Create a new app.js file. Now you can see another example of Meteor's power and simplicity - no need to include this file anywhere. Meteor will take care of it by going through all the files in the folder and including them automatically.
135
136
136
-
But Meteor's goal is to break down the barrier between client and server, and the code you write runs everywhere! (more on that later).
137
+
One of Meteor's goals is to break down the barrier between client and server, so the code you write can run everywhere! (more on that later).
137
138
But we need Angular's power only in the client side, so how can we do that?
138
139
139
-
There are a few ways to tell Meteor to run a code only on the client/server/phone side, let's start with the simplest way - Meteor.isClient variable.
140
+
There are a few ways to tell Meteor to run code only on the client/server/phone side, let's start with the simplest way - Meteor.isClient variable.
140
141
141
142
__`app.js`:__
142
143
143
144
if (Meteor.isClient) {
144
145
145
146
}
146
147
147
-
Now anything that will happen inside this if statement will run only on the client side.
148
+
Now everything inside this 'if' statement will only run on the client side.
148
149
149
-
So let's continue with starting our AngularJS application, we will call it "socially":
150
+
Let's continue defining our AngularJS application module, and give it the name "socially":
150
151
151
152
__`app.js`:__
152
153
153
154
if (Meteor.isClient) {
154
155
angular.module('socially',['angular-meteor']);
155
156
}
156
157
157
-
And name our application in the ng-app directive in index.html:
158
+
And use the same application name in the ng-app directive in index.html:
158
159
159
160
<bodyng-app="socially">
160
161
<divng-include="'index.ng.html'"></div>
161
162
</body>
162
163
163
-
What we did here is to declare a new angular module named 'socially' and making it dependant on the 'angular-meteor' module (that we included in the first step).
164
+
What we did here is to declare a new angular module named 'socially' and make it dependant on the 'angular-meteor' module (that we included in the first step).
164
165
165
166
Now run the app.
166
167
167
-
everything is the same.
168
-
169
-
and now inside our index.ng.html let's use Angular:
168
+
Everything is the same, but now inside our index.ng.html let's use Angular:
* A binding, denoted by double curly braces {{dstache}} }}
181
180
* a simple expression 'yet' + '!' used in this binding.
182
181
183
-
AngularJS finds those double curly braces, evaluates the expression and inserts the result into the DOM in place of the binding.
182
+
AngularJS finds the double curly braces, evaluates the expression and inserts the result into the DOM in place of the binding.
184
183
Rather than a one-time insert, as we'll see in the next steps, a binding will result in efficient continuous updates whenever the result of the expression evaluation changes.
185
-
Inside in the client side, like a future smart browser would do.
184
+
Inside in the client side code, like a future smart browser would do.
186
185
187
186
188
-
> Why did use a new file extension file.ng.html ?
187
+
> Why did we use the new file extension file.ng.html ?
189
188
>
190
-
> That is because Meteor templating system uses double-curlies. If we use them in our AngularJS view HTML, Meteor will override Angular.
189
+
> That's because the Meteor templating system uses double-curlies. If we use them in our AngularJS view HTML, Meteor will override Angular.
191
190
>
192
-
> Fortunately, we created a new file extension to make Meteor not override our Angular expression.
191
+
> Fortunately, we created a new file extension to stop Meteor overriding our Angular expression.
193
192
>
194
193
> If you still want to use HTML files without changing their extension, Angular (unlike Meteor...) gives us the [option to change the double-curlies to Double-square-brackets](http://stackoverflow.com/a/12923955/1426570)
0 commit comments