diff options
author | Danijel Andjelkovic <adanijel99@gmail.com> | 2022-03-14 23:36:24 +0100 |
---|---|---|
committer | Danijel Andjelkovic <adanijel99@gmail.com> | 2022-03-14 23:36:24 +0100 |
commit | b93854c0f0f9fe011aab6bdef324d236fd8dadc8 (patch) | |
tree | 98808e8b96b588b9d805f5001e8915d1cb367c43 /frontend/src/app/_modals/login-modal/login-modal.component.ts | |
parent | 6aeb963fa64af9dc0ddf2f9aeaf1903a7db26afc (diff) | |
parent | 7ff5981a464b17f84b7e0268077c5ba6ec131e21 (diff) |
Merge branch 'dev' of http://gitlab.pmf.kg.ac.rs/igrannonica/neuronstellar into frontendNaslovna
# Conflicts:
# frontend/angular.json
# frontend/src/app/app-routing.module.ts
# frontend/src/app/app.module.ts
Diffstat (limited to 'frontend/src/app/_modals/login-modal/login-modal.component.ts')
-rw-r--r-- | frontend/src/app/_modals/login-modal/login-modal.component.ts | 22 |
1 files changed, 6 insertions, 16 deletions
diff --git a/frontend/src/app/_modals/login-modal/login-modal.component.ts b/frontend/src/app/_modals/login-modal/login-modal.component.ts index 3a6fd8f1..22bd9a28 100644 --- a/frontend/src/app/_modals/login-modal/login-modal.component.ts +++ b/frontend/src/app/_modals/login-modal/login-modal.component.ts @@ -1,11 +1,7 @@ import { Component, OnInit, ViewChild } from '@angular/core'; -import { FormControl, FormGroup } from '@angular/forms'; import { Router } from '@angular/router'; import { CookieService } from 'ngx-cookie-service'; import { AuthService } from 'src/app/_services/auth.service'; -import { ElementRef } from '@angular/core'; - -declare var window: any; @Component({ selector: 'app-login-modal', @@ -14,7 +10,6 @@ declare var window: any; }) export class LoginModalComponent implements OnInit { - loginModal: any; username: string = ''; password: string = ''; @@ -27,25 +22,20 @@ export class LoginModalComponent implements OnInit { ) { } ngOnInit(): void { - this.loginModal = new window.bootstrap.Modal( - document.getElementById("modalForLogin") - ); } - openModal() { - this.loginModal.show(); - //console.log("ok"); - //(<HTMLInputElement>document.getElementById("exampleModal")).style.display = "block"; - } doLogin() { this.authService.login(this.username, this.password).subscribe((response) => { //ako nisu ok podaci, ne ide hide nego mora opet da ukucava!!!!podesi console.log(response); this.cookie.set('token', response); - this.loginModal.hide(); //dodato + (<HTMLSelectElement>document.getElementById('closeButton')).click(); this.router.navigate(['add-model']); + }, error => { + console.warn(error); //NETACNI PODACI }); } - sendToRegister() { - + resetData() { + this.username = ''; + this.password = ''; } } |