Skip to content

Commit

Permalink
JSON prep
Browse files Browse the repository at this point in the history
  • Loading branch information
nunofreitas96 committed Jun 26, 2020
1 parent 6e480c3 commit 98aa371
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@

<mat-form-field>
<mat-label>Change Type</mat-label>
<mat-select [(value)]=titleType>
<mat-option *ngFor="let title of titleTypes" [value]="title.option">
<mat-select [(value)]=titleType (selectionChange)="changeTitleTypeVal($event)">
<mat-option *ngFor="let title of titleTypes" [value]="title.option" >
{{title.option}}
</mat-option>
</mat-select>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,27 @@ export class DocumentComponentComponent implements OnInit {
titleName = '';
identifierName = '';
identifierType = '';
titleTypeVal = '';
identifierTypeVal = '';

titleTypes = [];
identifierTypes = [];

id = {
value: '',
type: ''
};

titlef = {
value: '',
type: ''
};

deliveredJson = {
identifier : [],
title: []
};



ngOnInit() {
Expand Down Expand Up @@ -103,6 +120,25 @@ export class DocumentComponentComponent implements OnInit {

}

submitUpdate() {

let j: any;
// tslint:disable-next-line:forin
for (j in this.titleTypes) {
if (j.option === this.titleType) {
this.titleTypeVal = j.value;
}
}
// tslint:disable-next-line:forin
for (j in this.identifierTypes) {
if (j.option === this.identifierType) {
this.identifierTypeVal = j.value;
}
}
this.deliveredJson.identifier.push({value: this.identifierName, type: this.identifierTypeVal});
this.deliveredJson.title.push({value: this.titleName, type: this.titleTypeVal});
}

checkChange() {

// tslint:disable-next-line:max-line-length
Expand Down

0 comments on commit 98aa371

Please sign in to comment.