awendland / angular-json-tree

Angular directive for displaying a JSON object in an expandable tree structure
Other
79 stars 41 forks source link

Only add expandable class for Objects and Arrays that have data to ex… #63

Closed agi20dla closed 5 years ago

agi20dla commented 6 years ago

This change removes the expandable icon next to Objects and Arrays that do not have any data.

Description

This change is in line with the current documentation whereby it states, "The expanded state is different and contains further subnodes that are generated with ng-repeat: ". However, the current state of this directive displays the expandable even when there are no actual subnodes to display.

Motivation and Context

In an application we are using, we give users the option to see data in json format. However, any Object or Array is displayed with an expandable arrow, even if it doesn't have any data to expand. This causes clutter in the UI, and confusion for the user when no data is expanded.

How Has This Been Tested?

Only user testing was used as this is a very simple change. No automated tests were run.

Screenshots (if appropriate):

Types of changes

Checklist: