As a beginner in the world of Angular framework and web development, I am struggling to display images stored in local storage.
<tr *ngFor = "let item of unused; let i = index ; ">
<div style="padding-left:25%;padding-top:0%;" class="row">
<img src="" id="imageID{{i}}" style ="width: 100%;height: 100%;padding-right: 50px;padding-bottom: 15px;" >
</div>
</tr>
I have declared the array variable globally and used it in ngOnit like this
unused=[1,2,3,4,5]
for (let i=0; i<5;i++)
{
var n = i.toString();
var dataImage = localStorage.getItem(("image"+ n));
var bannerImg = document.getElementById(("imageID"+n)) as HTMLImageElement;
bannerImg.src = dataImage;
}