File tree 4 files changed +6
-20
lines changed
4 files changed +6
-20
lines changed Original file line number Diff line number Diff line change @@ -7,7 +7,6 @@ import {Component} from '@angular/core';
7
7
<app-header></app-header>
8
8
<div class="container" align="center">
9
9
<router-outlet></router-outlet>
10
- </div>
11
- `
10
+ </div> `
12
11
} )
13
12
export class AppComponent { }
Original file line number Diff line number Diff line change @@ -13,6 +13,4 @@ import {GameServerService} from './game-server.service';
13
13
imports : [ AppRoutingModule , SharedModule ] ,
14
14
providers : [ GameServerService ]
15
15
} )
16
- export class CoreModule {
17
-
18
- }
16
+ export class CoreModule { }
Original file line number Diff line number Diff line change @@ -30,7 +30,8 @@ export class GameServerService {
30
30
const token = this . parseToken ( ) ;
31
31
return this . http . post ( 'https://www.localghost.dk/hangman/api/hangman/game' , null ,
32
32
{ headers : new HttpHeaders ( ) . set ( 'Authorization' , 'Bearer ' + token ) }
33
- ) . pipe ( map ( ( res : Response ) => {
33
+ ) . pipe (
34
+ map ( ( res : Response ) => {
34
35
return res ;
35
36
} )
36
37
) ;
Original file line number Diff line number Diff line change 5
5
< img src ={{images[game.wrongLettersCount]}} />
6
6
</ div >
7
7
< hr >
8
- < div *ngIf ="game.hasGameBegun ">
8
+ < div *ngIf ="game.hasGameBegun || game.gameHasBeenWon || game.gameHasBeenLost ">
9
9
< p > < span class ="word-description "> {{game.wordExampleBefore}}</ span > < span class ="word "> {{game.visibleWord}}</ span > < span class ="word-description "> {{game.wordExampleAfter}}</ span > </ p >
10
10
< p class ="word-description " style ="font-style: italic " *ngIf ="game.wordDefinition?.length "> {{'Definition: '+game.wordDefinition}}</ p >
11
11
< p style ="font-style: italic ">
12
12
< span *ngIf ="game.wordSynonyms.length>0 "> Synonyms: </ span >
13
13
< span *ngFor ="let synonym of game.wordSynonyms "> {{synonym+ ', '}}</ span >
14
14
</ 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>-->
25
15
</ div >
26
16
< div >
27
17
< 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 >
31
19
{{gameStatus}}</ p >
32
20
< div >
33
21
< div >
You can’t perform that action at this time.
0 commit comments