login.page.ts 612 Bytes
Newer Older
Rron Jahja's avatar
Rron Jahja committed
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
import { Component, OnInit } from '@angular/core';
import { Router } from '@angular/router';

@Component({
  selector: 'app-login',
  templateUrl: './login.page.html',
  styleUrls: ['./login.page.scss'],
})
export class LoginPage implements OnInit {
  username = "";
  password = "";
  correctCredentials=false;

  constructor(private router: Router) { }


  ngOnInit() {
  }
  clickMe() {
    if (this.username === "admin" && this.password === "admin" || this.username === "demo" && this.password === "demo") {

      this.router.navigateByUrl('/home');
    }
    else { this.correctCredentials=true; }


  }
}