Skip to content

Commit

Permalink
Some bugfixes and added partial functionality for removing players
Browse files Browse the repository at this point in the history
  • Loading branch information
Baukebrenninkmeijer committed Sep 13, 2017
1 parent 809d509 commit 6140010
Show file tree
Hide file tree
Showing 8 changed files with 12 additions and 5,077 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,5 @@ src/app/player\.service\.js\.map
src/main\.js

src/main\.js\.map

dist/
65 changes: 0 additions & 65 deletions dist/app.js

This file was deleted.

13 changes: 0 additions & 13 deletions dist/index.html

This file was deleted.

2,202 changes: 0 additions & 2,202 deletions dist/polyfills.js

This file was deleted.

2,796 changes: 0 additions & 2,796 deletions dist/vendor.js

This file was deleted.

2 changes: 1 addition & 1 deletion src/app/app.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ <h3>Spelers</h3>
<input [(ngModel)]="selectedPlayer.name" placeholder="Naam" type="text" class="form-control name-field">
<button *ngIf="selectedPlayer.id" (click)='playerSave()' type='submit' class="btn btn-primary editbutton">Opslaan</button>
<button *ngIf="selectedPlayer.id" (click)='playerSave()' type='submit' class="btn btn-danger editbutton">Remove</button>
<button *ngIf="!selectedPlayer.id" (click)='playerAdd()' type='submit' class="btn btn-normal">Toevoegen</button>
<button *ngIf="!selectedPlayer.id" (click)='playerAdd()' type='submit' class="btn btn-normal addbtn">Toevoegen</button>
</div>
<table class="table players">
<tr>
Expand Down
5 changes: 5 additions & 0 deletions src/app/app.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -99,4 +99,9 @@ export class AppComponent implements OnInit {
this.getPlayers();
}

playerRemove(){
this.playerService.removePlayer(this.selectedPlayer);
this.getPlayers();
}

}
4 changes: 4 additions & 0 deletions src/app/player.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,4 +38,8 @@ export class PlayerService {
gotPitcher(player:Player): any {
return this.http.post('/api/log', {player_id: player.id}).subscribe();
}

removePlayer(player:Player): any {
return this.http.delete('/api/removePlayer/' + player.id).subscribe();
}
}

0 comments on commit 6140010

Please sign in to comment.