-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocument.ts
More file actions
38 lines (33 loc) · 1.08 KB
/
document.ts
File metadata and controls
38 lines (33 loc) · 1.08 KB
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
import { Component, OnInit } from '@angular/core';
import { FormBuilder, FormGroup, Validators } from '@angular/forms';
import { HttpClient } from '@angular/common/http';
@Component({
templateUrl: './document.html'
})
export class DocumentPropertiesComponent implements OnInit {
userForm!: FormGroup;
showLoading!: boolean;
documentProperties: any;
constructor(
private formBuilder: FormBuilder,
private http: HttpClient,
) { }
onSubmit(): void {
if (this.userForm.invalid) {
console.warn('Fill required fields');
} else {
this.showLoading = true;
this.http.get('http://localhost:8080/api/getDocumentProperties/?documentId=' + this.userForm.value.documentId)
.subscribe(data => {
this.showLoading = false;
this.documentProperties = data;
});
}
}
ngOnInit() {
this.showLoading = false;
this.userForm = this.formBuilder.group({
documentId: ['', Validators.required],
});
}
}