Retrieving categories from API
This commit is contained in:
parent
3da4c4164d
commit
83c2fdd4dd
1 changed files with 12 additions and 0 deletions
|
@ -37,6 +37,8 @@ export class AddDataComponent implements OnInit {
|
||||||
transactionFormInvalid = true;
|
transactionFormInvalid = true;
|
||||||
myDate: any;
|
myDate: any;
|
||||||
minDate: any;
|
minDate: any;
|
||||||
|
categoryIds: number[] = [];
|
||||||
|
categoryNames: string[] = [];
|
||||||
|
|
||||||
constructor(
|
constructor(
|
||||||
private formBuilder: FormBuilder,
|
private formBuilder: FormBuilder,
|
||||||
|
@ -64,6 +66,16 @@ export class AddDataComponent implements OnInit {
|
||||||
});
|
});
|
||||||
this.myDate = moment().format('YYYY-MM-DD[T]HH:mm');
|
this.myDate = moment().format('YYYY-MM-DD[T]HH:mm');
|
||||||
// this.myDate = new Date().toISOString().slice(0, 16);
|
// this.myDate = new Date().toISOString().slice(0, 16);
|
||||||
|
this.api.categoryList().subscribe(
|
||||||
|
result => {
|
||||||
|
this.categories = result;
|
||||||
|
console.log(this.categories);
|
||||||
|
},
|
||||||
|
error => {
|
||||||
|
console.log('Retrieval Error');
|
||||||
|
console.log( error._body );
|
||||||
|
}
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
ngOnInit(): void {
|
ngOnInit(): void {
|
||||||
|
|
Reference in a new issue