Skip to content

Commit

Permalink
The Basics finished
Browse files Browse the repository at this point in the history
  • Loading branch information
Huascar321 committed Jun 30, 2022
1 parent b7713dd commit e6b7fc3
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 41 deletions.
2 changes: 1 addition & 1 deletion src/app/app.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ <h3>I'm in the AppComponent!</h3>
<hr>
<button class="btn btn-primary" (click)="showHidden($event)">Display Details</button>
<p *ngIf="isDisplaying">Secret: Password = tune</p>
<p [ngStyle]="{backgroundColor: getColor()}" *ngFor="let clicInfo of buttonClicks">{{ buttonClicks }}</p>
<div [ngStyle]="{backgroundColor: i >= 4 ? 'blue' : 'transparent'}" *ngFor="let clicInfo of buttonClicks; let i = index" [ngClass]="{}">{{ buttonClicks }}</div>
</div>
</div>
</div>
31 changes: 0 additions & 31 deletions src/app/app.component.spec.ts

This file was deleted.

9 changes: 0 additions & 9 deletions src/app/app.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@ export class AppComponent {
isUsernameEmpty: boolean = false;
isDisplaying: boolean = false;
buttonClicks: string[] = [];
counter: number = 0;
areFiveElements: boolean = false;

onResetUsername(event: Event) {
this.username = '';
Expand All @@ -28,15 +26,8 @@ export class AppComponent {
}

private registerButtonClicks(event: Event): void {
this.counter === 4 ? this.areFiveElements = true : false;
let toDate = new Date(event.timeStamp);
let data = `${toDate.getMinutes()}:${toDate.getUTCSeconds()}`
this.buttonClicks.push(data);
this.counter++;
}

getColor(): string {
return this.areFiveElements ? 'blue' : '' ;
}

}

0 comments on commit e6b7fc3

Please sign in to comment.