As a newcomer to Angular, this question may be straightforward for some.
I have a collection of portfolio cases that I want to showcase.
Is there a way to create an additional file where I can store an array of cases and perhaps include images for each case, so that I can easily access and iterate through this array in different components?
Additionally, I would like to show the images associated with a specific case from this extra file when hovering over the case displayed using *ngFor
.
How can I achieve this in Angular? - Is it feasible?
So far, my approach (I want this to be universal and also contain images) has been:
HTML:
<div class="container-fluid d-flex justify-content-center">
<ul>
<li class="text-center" *ngFor="let case of cases">
{{ case }}
</li>
</ul>
</div>
TS:
export class CaseListComponent implements OnInit {
cases = [
['Diesel'],
['WeWork Berlin'],
['Fritzhansen'],
['Savum'],
['Eskay'],
['Diesel'],
['Mobilia'],
['Rarekind']
]
...
}