Guest User

Untitled

a guest
Dec 12th, 2017
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.83 KB | None | 0 0
  1. import {Component, View, Injectable, CORE_DIRECTIVES, FORM_DIRECTIVES} from 'angular2/angular2';
  2. import {AuthService} from '../../authService';
  3.  
  4. @Injectable()
  5. class User{
  6. email:string;
  7. password: string;
  8. }
  9.  
  10. @Component({
  11. selector: 'Login',
  12. })
  13.  
  14. @View({
  15. templateUrl: '/src/app/components/login/login.html',
  16. directives: [CORE_DIRECTIVES, FORM_DIRECTIVES],
  17. })
  18.  
  19. @Injectable()
  20. export class Login {
  21. authService:AuthService;
  22. user: User;
  23.  
  24. constructor(authService: AuthService, user: User){
  25. this.authService = authService;
  26. this.user = user;
  27. }
  28.  
  29. login = () => {
  30. console.log("login");
  31. }
  32. }
  33. enter code here
  34.  
  35. <section class="container centered">
  36. <div class="row">
  37. <div class="well bs-component col-xs-12 col-xs-offset-0 col-sm-12 col-sm-offset-0 col-md-6 col-md-offset-3 col-lg-offset-4 col-lg-4">
  38. <h3>Log In</h3>
  39.  
  40. <form class="padding-top-20" role="form" novalidate>
  41. <div class="form-group">
  42. <input class="form-control" type="text" name="email" id="email" placeholder="Email Address" [(ng-model)]="user.userName" required autofocus />
  43. </div>
  44.  
  45. <div class="form-group">
  46. <input class="form-control" type="password" name="password" id="password" placeholder="Password" [(ng-model)]="user.password" required autofocus />
  47. </div>
  48.  
  49. <button class="btn btn-primary btn-wide" type="submit" (click)="login()">Log In</button>
  50.  
  51. <div class="padding-top-20 padding-bottom-20">
  52. <a href="/forgotpassword" title="Forgot Password?">Forgot Password?</a>
  53. </div>
  54. </form>
  55. </div>
  56. </div>
  57. </section>
  58.  
  59. @Component({
  60. selector: 'Login',
  61. providers: [Login, User]
  62. })
Add Comment
Please, Sign In to add comment