The cause of this "problem" is
change detection of Angular.
This process aims, in a brief explanation, to get all its
componentes and render it in
Each time a detection cycle is called, the component in question is completely reloaded, updating both
This is a default behavior, which is required for components to maintain an always up-to-date state.
In your scenario, this seems to be problematic as it appears that you have more than one item in the array. But this is not the case.
If we make a
div to show all content, it has only one:
<div *ngFor="let item of items">
Ifyoubuildyour project in production , it will only print once.