mohsen1 / json-formatter

Angular directive for collapsible JSON in HTML
http://azimi.me/json-formatter/demo/demo.html
Other
372 stars 85 forks source link

Should the key override the Object? #42

Open raykin opened 8 years ago

raykin commented 8 years ago

The code is

 json-formatter(key="::trace.defined_class" json="::trace.return_value"

The output is as screencast, so the 'Object' seems nonsense in this case. I tried find a config to hide the 'Object' , but failed. The 'Object' is useful as placeholder when no key value and constructor name.

json-formatter

mohsen1 commented 8 years ago

The key attribute is used internally for recursion. It doesn't expect user provide the key. Providing json should be enough.

raykin commented 8 years ago

got it, I saw the key is shared as json and open, so I expected it can be used as another feature.

My problem is I wanna give the json a title to replace the 'Object'. But I cant create constructors for the json because the json data is from ruby object. In the previous case, the return value is json stringfy of ruby object and the defined class is its class. How about add title attribute to make the display more meaningful in some case?