Skip to content

Commit d29e3a7

Browse files
committed
Merge branch 'study/06-cmp-deep-dive' of https://github.com/aimxnaim/angular-courses-udemy into study/06-cmp-deep-dive
2 parents 0aa1625 + 020fad5 commit d29e3a7

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

06-cmp-deep-dive/01-starting-project/src/app/dashboard/server-status/server-status.component.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,10 @@ export class ServerStatusComponent implements OnInit {
1616
constructor() {}
1717

1818
checkServerStatus() {
19-
if (Math.random() < 0.5) {
19+
const randomValue = Math.random();
20+
if (randomValue < 0.5) {
2021
this.currentStatus.set('online');
21-
} else if(Math.random() < 0.9) {
22+
} else if (randomValue < 0.9) {
2223
this.currentStatus.set('offline');
2324
} else {
2425
this.currentStatus.set('unknown');

0 commit comments

Comments
 (0)