Skip to content

Commit 9727038

Browse files
committed
fix(spec): hide block of code if the jsonData is empty
1 parent ac6c60f commit 9727038

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
<pre class="spec-code">{{jsonData | json}}</pre>
1+
<pre class="spec-code" *ngIf="hasData">{{jsonData | json}}</pre>

src/app/features/spec/components/spec-code/spec-code.component.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,8 @@ import { ChangeDetectionStrategy, Component, Input, ViewEncapsulation } from '@a
99
})
1010
export class SpecCodeComponent {
1111
@Input() jsonData: object;
12+
13+
get hasData(): boolean {
14+
return Object.keys(this.jsonData || {}).length > 0;
15+
}
1216
}

0 commit comments

Comments
 (0)