File tree Expand file tree Collapse file tree 2 files changed +11
-2
lines changed
projects/ngx-json-treeview/src/lib Expand file tree Collapse file tree 2 files changed +11
-2
lines changed Original file line number Diff line number Diff line change 32
32
@if (expandable) {
33
33
< div class ="toggler "> </ div >
34
34
}
35
- < span class ="segment-key "> {{ `"${segment.key}"` }}</ span >
35
+ @if (isArrayElement()) {
36
+ < span class ="segment-label "> {{ segment.key }}</ span >
37
+ } @else {
38
+ < span class ="segment-key "> {{ `"${segment.key}"` }}</ span >
39
+ }
40
+ </ span >
41
+ < span
42
+ [class.segment-label] ="isArrayElement() "
43
+ [class.punctuation] ="!isArrayElement() "
44
+ > :
36
45
</ span >
37
- < span class ="punctuation "> : </ span >
38
46
@if (empty) {
39
47
< span class ="punctuation "
40
48
> {{ openingBrace }}{{ closingBrace
Original file line number Diff line number Diff line change @@ -152,6 +152,7 @@ export class NgxJsonTreeviewComponent {
152
152
}
153
153
return 'segment-type-' + type ;
154
154
} ) ;
155
+ isArrayElement = computed < boolean > ( ( ) => this . rootType ( ) === 'array' ) ;
155
156
156
157
isExpandable ( segment : Segment ) {
157
158
return (
You can’t perform that action at this time.
0 commit comments