Unfortunately, it's not possible to achieve this functionality out of the box. The NgForOf directive in Angular allows for iterating over a collection, but by default, objects do not have the required methods and properties to be iterated over in this way. One potential workaround is to extract the keys of the object using the following code:
<p *ngFor="let property of Object.keys(object)">
{{property}} {{object[property]}}
</p>
However, due to how ngFor evaluates its contents, the global variable Object
is not accessible within its scope. A more effective solution would be to create a custom pipe that transforms your object into an iterable format that meets your specific requirements. It's unclear what exactly these requirements are without further explanation, as simply stating that "keyValuePipe or {{data | JSON}} is not a good solution" doesn't provide enough context or reasoning.