@@ -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 "./shared/user/user.service";
753+ < p > In app.component.ts. Add the lines below to the top:</ p >
754+ < pre > < code class ="lang-TypeScript "> import {HTTP_PROVIDERS} from "angular2/http";
755+ import {UserService} from "./shared/user/user.service";
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 "angular2/core";
798+ import {HTTP_PROVIDERS} from "angular2/http";
797799import {User} from "./shared/user/user";
798800import {UserService} from "./shared/user/user.service";
799801
800802@Component({
801803 selector: "my-app",
802804 templateUrl: "pages/login/login.html",
803805 styleUrls: ["pages/login/login-common.css", "pages/login/login.css"],
804- providers: [UserService]
806+ providers: [UserService, HTTP_PROVIDERS ]
805807})
806808export class AppComponent {
807809 user: User;
808810 isLoggingIn = true;
809811
810812 constructor(private _userService: UserService) {
811813 this.user = new User();
814+ this.user.email = "nativescriptrocks@telerik.com";
815+ this.user.password = "password";
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 "angular2/http";
840- import {nativeScriptBootstrap} from "nativescript-angular/application";
841- import {AppComponent} from "./app.component";
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 >
0 commit comments