Skip to content

Commit b3e647a

Browse files
committed
fix deleted filter
1 parent 11d5537 commit b3e647a

3 files changed

Lines changed: 6 additions & 2 deletions

File tree

src/app/data.service.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -216,6 +216,10 @@ export class DataService {
216216
}
217217
}
218218

219+
getPupilsVisible() {
220+
return this.getPupils().filter(x => !x.deleted);
221+
}
222+
219223
getPupil(id) {
220224
let pupils = this.getPupils();
221225
return pupils.filter(e => e.id == id)[0];

src/app/notes/notes.component.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ <h4 class="modal-title">Wirklich löschen?</h4>
9393
<label class="control-label col-sm-4" for="pupil">Schüler:</label>
9494
<div class="col-sm-8">
9595
<select class="form-control" id="pupil" [(ngModel)]="model.pupilId" required>
96-
<option *ngFor="let pupil of dataService.getPupils()" [value]="pupil.id">{{pupil.firstName}}
96+
<option *ngFor="let pupil of dataService.getPupilsVisible()" [value]="pupil.id">{{pupil.firstName}}
9797
{{pupil.lastName}}
9898
</option>
9999
</select>

src/app/pupil/pupil.component.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ <h1>Schülerübersicht</h1>
1515
<th>Einträge</th>
1616
<th></th>
1717
</tr>
18-
<tr class="clickable" *ngFor="let pupil of dataService.getPupils()" routerLink="/pupil/{{pupil.id}}">
18+
<tr class="clickable" *ngFor="let pupil of dataService.getPupilsVisible()" routerLink="/pupil/{{pupil.id}}">
1919
<td>{{pupil.firstName}}</td>
2020
<td>{{pupil.lastName}}</td>
2121
<td>{{dataService.getPupilClass(pupil.id).name}}</td>

0 commit comments

Comments
 (0)