Skip to content

Commit 68a0f93

Browse files
committed
update to Angular 6
1 parent 7688329 commit 68a0f93

File tree

4 files changed

+6
-20
lines changed

4 files changed

+6
-20
lines changed

src/app/app.component.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ import {Component} from '@angular/core';
77
<app-header></app-header>
88
<div class="container" align="center">
99
<router-outlet></router-outlet>
10-
</div>
11-
`
10+
</div> `
1211
})
1312
export class AppComponent {}

src/app/core/core.module.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,4 @@ import {GameServerService} from './game-server.service';
1313
imports: [AppRoutingModule, SharedModule],
1414
providers: [GameServerService]
1515
})
16-
export class CoreModule {
17-
18-
}
16+
export class CoreModule {}

src/app/core/game-server.service.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,8 @@ export class GameServerService {
3030
const token = this.parseToken();
3131
return this.http.post('https://www.localghost.dk/hangman/api/hangman/game', null,
3232
{headers: new HttpHeaders().set('Authorization', 'Bearer ' + token)}
33-
).pipe(map((res: Response) => {
33+
).pipe(
34+
map((res: Response) => {
3435
return res;
3536
})
3637
);

src/app/core/game/game.component.html

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -5,29 +5,17 @@
55
<img src={{images[game.wrongLettersCount]}} />
66
</div>
77
<hr>
8-
<div *ngIf="game.hasGameBegun">
8+
<div *ngIf="game.hasGameBegun || game.gameHasBeenWon || game.gameHasBeenLost">
99
<p><span class="word-description">{{game.wordExampleBefore}}</span> <span class="word">{{game.visibleWord}}</span> <span class="word-description">{{game.wordExampleAfter}}</span></p>
1010
<p class="word-description" style="font-style: italic" *ngIf="game.wordDefinition?.length">{{'Definition: '+game.wordDefinition}}</p>
1111
<p style="font-style: italic">
1212
<span *ngIf="game.wordSynonyms.length>0">Synonyms: </span>
1313
<span *ngFor="let synonym of game.wordSynonyms">{{synonym+ ', '}}</span>
1414
</p>
15-
<!--<p class="word-description" style="font-style: italic" *ngIf="game.wordDefinition.length==0">{{game.wordSynonyms[1]}}</p>-->
16-
</div>
17-
<div *ngIf="game.gameHasBeenWon || game.gameHasBeenLost">
18-
<p><span class="word-description">{{game.wordExampleBefore}}</span> <span class="word">{{game.finalGuessWord}}</span> <span class="word-description">{{game.wordExampleAfter}}</span></p>
19-
<p class="word-description" style="font-style: italic" *ngIf="game.wordDefinition?.length">{{'Definition: '+game.wordDefinition}}</p>
20-
<p style="font-style: italic">
21-
<span *ngIf="game.wordSynonyms.length>0">Synonyms: </span>
22-
<span *ngFor="let synonym of game.wordSynonyms">{{synonym+ ', '}}</span>
23-
</p>
24-
<!--<p class="word-description" style="font-style: italic" *ngIf="game.wordDefinition.length==0">{{game.wordSynonyms[1]}}</p>-->
2515
</div>
2616
<div>
2717
<p class="alert">
28-
<!--Nedenstående kunne gøres med NGclass men er fravalgt-->
29-
<span class="redText" *ngIf="redText.length>0"><strong>{{redText}}</strong></span>
30-
<span class="greenText" *ngIf="greenText.length>0"><strong>{{greenText}}</strong></span>
18+
<span [ngClass]="{'redText':redText.length>0, 'greenText':greenText.length>0}"><strong>{{redText}}{{greenText}}</strong></span>
3119
{{gameStatus}}</p>
3220
<div>
3321
<div>

0 commit comments

Comments
 (0)