aboutsummaryrefslogtreecommitdiff
path: root/frontend/src/app/_pages/login-page/login-page.component.ts
blob: e5366283b3563603051a136e85068401870716bd (plain) (blame)
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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
import { Component, OnInit } from '@angular/core';
import { Router } from '@angular/router';
import { CookieService } from 'ngx-cookie-service';
import { AuthService } from 'src/app/_services/auth.service';

import { LoginModalComponent } from 'src/app/_modals/login-modal/login-modal.component';
import { MDBModalRef, MDBModalService } from 'ng-uikit-pro-standard';


declare var window: any;

@Component({
  selector: 'app-login-page',
  templateUrl: './login-page.component.html',
  styleUrls: ['./login-page.component.css'],
  
})
export class LoginPageComponent{

  modalRef?: MDBModalRef;

  //email: string = '';
  username: string = '';
  password: string = '';

  public wrongCreds: boolean = false;      //RAZMOTRITI
  //public notApproved: boolean = false;     //RAZMOTRITI

  formModal: any;

  constructor(
    private authService: AuthService,
    private cookie: CookieService,
    private router: Router,
    private modalService: MDBModalService
  ) { }

  openModal() {
    //this.modalRef = this.modalService.show(LoginModalComponent);
  }
  /*
  ngOnInit(): void {
    this.formModal = new window.bootstrap.Modal(
      document.getElementById("exampleModal")
    );
  }

  openModal() {
    this.formModal.show();
    //console.log("ok");
    //(<HTMLInputElement>document.getElementById("exampleModal")).style.display = "block";
  }

  onSubmit() {

    this.authService.login(this.username, this.password).subscribe((response) => {
      console.log(response);
      this.cookie.set('token', response);
      this.router.navigate(['add-model']);
    });
  }
*/
}