emergency fix for category viewing on purchase
This commit is contained in:
parent
675f319993
commit
c8c52d33c4
2 changed files with 7 additions and 4 deletions
|
@ -85,13 +85,13 @@
|
|||
</div>
|
||||
<div class="radio" *ngFor="let category of leftCategoryIdList, let i=index">
|
||||
<input [value]="category" type="radio" name="radios" [(ngModel)]="categoryId">
|
||||
<label>{{ categoryNameList[i] }}</label>
|
||||
<label>{{ leftCategoryNameList[i] }}</label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<div class="radio" *ngFor="let category2 of rightCategoryIdList, let i=index">
|
||||
<input [value]="category2" type="radio" name="radios" [(ngModel)]="categoryId">
|
||||
<label>{{ categoryNameList[category2 - 1] }}</label>
|
||||
<label>{{ rightCategoryNameList[i] }}</label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
@ -44,7 +44,8 @@ export class AddDataComponent implements OnInit {
|
|||
minDate: any;
|
||||
leftCategoryIdList: number[] = [];
|
||||
rightCategoryIdList: number[] = [];
|
||||
categoryNameList: string[] = [];
|
||||
leftCategoryNameList: number[] = [];
|
||||
rightCategoryNameList: number[] = [];
|
||||
|
||||
constructor(
|
||||
private formBuilder: FormBuilder,
|
||||
|
@ -90,10 +91,12 @@ export class AddDataComponent implements OnInit {
|
|||
|
||||
private setCategoryList(data: any) {
|
||||
let categoryIdList = Object.keys(data.ids).map(key => data.ids[key]);
|
||||
this.categoryNameList = Object.keys(data.names).map(key => data.names[key]);
|
||||
let categoryNameList = Object.keys(data.names).map(key => data.names[key]);
|
||||
let halfLength = Math.floor(categoryIdList.length / 2);
|
||||
this.leftCategoryIdList = categoryIdList.splice(0, halfLength);
|
||||
this.leftCategoryNameList = categoryNameList.splice(0, halfLength);
|
||||
this.rightCategoryIdList = categoryIdList;
|
||||
this.rightCategoryNameList = categoryNameList;
|
||||
}
|
||||
|
||||
getMinDate() {
|
||||
|
|
Reference in a new issue