Angular has the following HTML and components:
The IconInfo class has an icon and icon name.
When the button is pressed from the screen, addIconInfo is called and
Each time a button is pressed, an icon is added to the screen.
Therefore,
in the area where icons are displayed when icons are added
From the bottom to the top (as if it were accumulating on top)
I'd like to, but is there any way?
Would it be difficult to do it with ngFor alone?
◆ HTML
<div class="page">
<section class="card">
<ng-container*ngFor="letion of icons">
<div class="media">
<img src={icon.img}}>
</div>
</ng-container>
</section>
</div>
◆ Components.ts
addIconInfo(icon:string, name:string){
This.icons.push (new IconInfo(icon, name));
}
I don't know what this.icons
looks like, but if it's simply Array
, it's not push
to add it to the end, but unshift
to add it to the beginning.
this.icons.unshift (new IconInfo(icon, name));
618 Uncaught (inpromise) Error on Electron: An object could not be cloned
915 When building Fast API+Uvicorn environment with PyInstaller, console=False results in an error
574 Who developed the "avformat-59.dll" that comes with FFmpeg?
572 rails db:create error: Could not find mysql2-0.5.4 in any of the sources
© 2024 OneMinuteCode. All rights reserved.