SHARE
TWEET

Untitled

a guest Jun 16th, 2019 72 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <app-login>
  2.  
  3.   </app-login>
  4.  
  5. <div class="page-header" >
  6.    <div class="container">
  7.     <h1>Smrt File Comparison Tool</h1>
  8.  
  9.  
  10.  
  11.       <div *ngIf="authService.getUser()" class="navLinks">
  12.         <a  [routerLink]="['/home']"> Home</a>
  13.         <a [routerLink]="['/about']"> About App</a>
  14.         <a [routerLink]="['/copybook']"> View CopyBooks</a>
  15.  
  16.         <a [routerLink]="['/datadictionary']">View Data Dictionaries</a>
  17.  
  18.         <a [routerLink]="['/compare']">Compare Two smrt files</a>
  19.  
  20.         <a [routerLink]="['/datafileview']">View Data Files</a>
  21.  
  22.         <a [routerLink]="['/login']">Login</a>
  23.         <a [routerLink]="['/protected']">Protected</a>
  24.     </div>
  25.  
  26.  
  27.   </div>
  28. </div>
  29.  
  30. <div id="content">
  31.   <div class="container">
  32.    <router-outlet></router-outlet>
  33.   </div>
  34. </div>
  35.      
  36. import { Component } from '@angular/core';
  37. import { AuthService } from '../auth.service';
  38.  
  39. @Component({
  40.   selector: 'app-login',
  41.   templateUrl: './login.component.html',
  42.   styleUrls: ['./login.component.css']
  43. })
  44. export class LoginComponent {
  45.   message: string;
  46.  
  47.   constructor(public authService: AuthService) {
  48.     this.message = '';
  49.   }
  50.  
  51.   login(username: string, password: string): boolean {
  52.     this.message = '';
  53.     if (!this.authService.login(username, password)) {
  54.       this.message = 'Incorrect credentials.';
  55.       setTimeout(function() {
  56.         this.message = '';
  57.       }.bind(this), 2500);
  58.     }
  59.     return false;
  60.   }
  61.  
  62.   logout(): boolean {
  63.     this.authService.logout();
  64.     return false;
  65.   }
  66.  
  67. }
  68.      
  69. <h1>Login</h1>
  70.  
  71. <div class="alert alert-danger" role="alert" *ngIf="message">
  72.   {{ message }}
  73. </div>
  74.  
  75. <form class="form-inline" *ngIf="!authService.getUser()">
  76.   <div class="form-group">
  77.     <label for="username">User: (type <em>user</em>)</label>
  78.     <input class="form-control" name="username" #username>
  79.   </div>
  80.  
  81.   <div class="form-group">
  82.     <label for="password">Password: (type <em>password</em>)</label>
  83.     <input class="form-control" type="password" name="password" #password>
  84.   </div>
  85.  
  86.   <a class="btn btn-default" (click)="login(username.value, password.value)">
  87.     Submit
  88.   </a>
  89. </form>
  90.  
  91. <div class="well" *ngIf="authService.getUser()">
  92.   Logged in as <b>{{ authService.getUser() }}</b>
  93.   <a href (click)="logout()">Log out</a>
  94. </div>
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top