This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { createStackNavigator } from '@react-navigation/stack'; | |
export enum MainRoutes { | |
HomeScreen = 'HomeScreen', | |
MenuScreen = 'MenuScreen', | |
} | |
export type MainStackParamList = { | |
[MainRoutes.HomeScreen]: undefined; | |
[MainRoutes.MenuScreen]: undefined; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<form fxLayout="column" name="form" [formGroup]="form"> | |
<div fxLayout.lt-md="column" fxFlex="1 0 "> | |
<mat-form-field appearance="outline"> | |
<mat-label>Student Number</mat-label> | |
<input matInput formControlName="StudentNumber" [(ngModel)]="data.StudentNumber"> | |
</mat-form-field> | |
<mat-form-field appearance="outline"> | |
<mat-label>Name</mat-label> | |
<input matInput formControlName="Name" [(ngModel)]="data.Name"> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
onChange(): void { | |
this.form.get('studentNumber').valueChanges.subscribe(number => { | |
//assumed that student number must be 5 digits | |
if (number.length === 5) { | |
this._service.studentInfo(number).subscribe(response => { | |
this.data = response; | |
}); | |
} | |
} | |
else { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
removeItem(i:number):void { | |
this.Items.splice(i,1); | |
} | |
addItem():void { | |
this.Items.push({ | |
Name:'', | |
DateofBirth:Date, | |
IsAccepted:false, | |
File:null | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
tempFileIndex:number; | |
itemFileNummber(i):void { | |
this.tempFileIndex=i; | |
} | |
handleAddFileInputForm(files:FileList):void { | |
this.Items[this.tempFileIndex].File=files.item(0); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<form #ItemsForm="ngForm" class="container my-3" > | |
<section *ngFor="let item of Items; let i=index"> | |
<div> | |
<mat-form-field appearance="outline" class="pr-4" > | |
<mat-label>Name</mat-label> | |
<input matInput [(ngModel)]="item.Name" name="Name_{{i}}"> | |
</mat-form-field> | |
<mat-form-field appearance="outline" class="pr-4" > | |
<mat-label>Date of Birth</mat-label> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<button mat-raised-button (click)="itemFile_i.click();itemFileNumber(i)">Choose File </button> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<input hidden #itemFile_i (change)="handleAddFileInputFrom($event.target.files)" type="file"> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Items:any []={ | |
Name:'', | |
DateofBirth:new Date(), | |
isAccepted:false, | |
File:null | |
} |