Skip to content

Commit 2373f7c

Browse files
committed
Finishing up the instructions for 3.3
1 parent 9ec757c commit 2373f7c

File tree

2 files changed

+17
-27
lines changed

2 files changed

+17
-27
lines changed

index.html

Lines changed: 9 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -750,16 +750,17 @@ <h4 class="exercise-start">
750750
}
751751
</code></pre>
752752
<p>TODO: Explain that mess above, and probably break it into a lot of steps.</p>
753-
<p>In app.component.ts. Add the line below to the top:</p>
754-
<pre><code class="lang-TypeScript">import {UserService} from &quot;./shared/user/user.service&quot;;
753+
<p>In app.component.ts. Add the lines below to the top:</p>
754+
<pre><code class="lang-TypeScript">import {HTTP_PROVIDERS} from &quot;angular2/http&quot;;
755+
import {UserService} from &quot;./shared/user/user.service&quot;;
755756
</code></pre>
756757
<p>Then change the constructor to this:</p>
757758
<pre><code class="lang-TypeScript">constructor(private _userService: UserService) {
758759
this.user = new User();
759760
}
760761
</code></pre>
761762
<p>Add this line to the @Component:</p>
762-
<pre><code class="lang-TypeScript">providers: [UserService],
763+
<pre><code class="lang-TypeScript">providers: [UserService, HTTP_PROVIDERS]
763764
</code></pre>
764765
<p>Then change the submit function to this:</p>
765766
<pre><code class="lang-TypeScript">submit() {
@@ -794,21 +795,24 @@ <h4 class="exercise-start">
794795
</code></pre>
795796
<p>Full app.component.ts:</p>
796797
<pre><code class="lang-TypeScript">import {Component} from &quot;angular2/core&quot;;
798+
import {HTTP_PROVIDERS} from &quot;angular2/http&quot;;
797799
import {User} from &quot;./shared/user/user&quot;;
798800
import {UserService} from &quot;./shared/user/user.service&quot;;
799801

800802
@Component({
801803
selector: &quot;my-app&quot;,
802804
templateUrl: &quot;pages/login/login.html&quot;,
803805
styleUrls: [&quot;pages/login/login-common.css&quot;, &quot;pages/login/login.css&quot;],
804-
providers: [UserService]
806+
providers: [UserService, HTTP_PROVIDERS]
805807
})
806808
export class AppComponent {
807809
user: User;
808810
isLoggingIn = true;
809811

810812
constructor(private _userService: UserService) {
811813
this.user = new User();
814+
this.user.email = &quot;nativescriptrocks@telerik.com&quot;;
815+
this.user.password = &quot;password&quot;;
812816
}
813817
submit() {
814818
if (this.isLoggingIn) {
@@ -835,17 +839,9 @@ <h4 class="exercise-start">
835839
}
836840
}
837841
</code></pre>
838-
<p>Also change main.ts to use this:</p>
839-
<pre><code class="lang-TypeScript">import {HTTP_PROVIDERS} from &quot;angular2/http&quot;;
840-
import {nativeScriptBootstrap} from &quot;nativescript-angular/application&quot;;
841-
import {AppComponent} from &quot;./app.component&quot;;
842-
843-
nativeScriptBootstrap(AppComponent, [HTTP_PROVIDERS]);
844-
</code></pre>
845842
<div class="exercise-end"></div>
846843

847-
848-
844+
<p>Show that user account creation now works and transition to routing.</p>
849845
<h3 id="routing">Routing</h3>
850846

851847
</div>

src/chapters/chapter3.md

Lines changed: 8 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -289,9 +289,10 @@ export class UserService {
289289

290290
TODO: Explain that mess above, and probably break it into a lot of steps.
291291

292-
In app.component.ts. Add the line below to the top:
292+
In app.component.ts. Add the lines below to the top:
293293

294294
``` TypeScript
295+
import {HTTP_PROVIDERS} from "angular2/http";
295296
import {UserService} from "./shared/user/user.service";
296297
```
297298

@@ -306,7 +307,7 @@ constructor(private _userService: UserService) {
306307
Add this line to the @Component:
307308

308309
``` TypeScript
309-
providers: [UserService],
310+
providers: [UserService, HTTP_PROVIDERS]
310311
```
311312

312313
Then change the submit function to this:
@@ -353,21 +354,24 @@ Full app.component.ts:
353354

354355
``` TypeScript
355356
import {Component} from "angular2/core";
357+
import {HTTP_PROVIDERS} from "angular2/http";
356358
import {User} from "./shared/user/user";
357359
import {UserService} from "./shared/user/user.service";
358360

359361
@Component({
360362
selector: "my-app",
361363
templateUrl: "pages/login/login.html",
362364
styleUrls: ["pages/login/login-common.css", "pages/login/login.css"],
363-
providers: [UserService]
365+
providers: [UserService, HTTP_PROVIDERS]
364366
})
365367
export class AppComponent {
366368
user: User;
367369
isLoggingIn = true;
368370

369371
constructor(private _userService: UserService) {
370372
this.user = new User();
373+
this.user.email = "nativescriptrocks@telerik.com";
374+
this.user.password = "password";
371375
}
372376
submit() {
373377
if (this.isLoggingIn) {
@@ -395,18 +399,8 @@ export class AppComponent {
395399
}
396400
```
397401

398-
Also change main.ts to use this:
399-
400-
``` TypeScript
401-
import {HTTP_PROVIDERS} from "angular2/http";
402-
import {nativeScriptBootstrap} from "nativescript-angular/application";
403-
import {AppComponent} from "./app.component";
404-
405-
nativeScriptBootstrap(AppComponent, [HTTP_PROVIDERS]);
406-
```
407-
408402
<div class="exercise-end"></div>
409403

410-
404+
Show that user account creation now works and transition to routing.
411405

412406
### Routing

0 commit comments

Comments
 (0)