Skip to content

Commit

Permalink
fix(spec): hide block of code if the jsonData is empty
Browse files Browse the repository at this point in the history
  • Loading branch information
loktionov129 committed Jul 25, 2018
1 parent ac6c60f commit 9727038
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<pre class="spec-code">{{jsonData | json}}</pre>
<pre class="spec-code" *ngIf="hasData">{{jsonData | json}}</pre>
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,8 @@ import { ChangeDetectionStrategy, Component, Input, ViewEncapsulation } from '@a
})
export class SpecCodeComponent {
@Input() jsonData: object;

get hasData(): boolean {
return Object.keys(this.jsonData || {}).length > 0;
}
}

0 comments on commit 9727038

Please sign in to comment.