When working with Angular 2, how can I effectively utilize ngFor to work with data across different component files?
For instance, in my playbar.component.ts file I have the following code snippet:
...
<audio
gFor="let audio of sources"
#mediaOne
[vgMedia]="mediaOne"
id="mediaOne"
crossorigin
[src]="currentItem.src">
...
Meanwhile, in my tunes.component.ts template (with the above file imported), I have the following code:
...
<ul>
<li *ngFor="let item of sources; let $index = index"
(click)="onClickPlaylistItem(item, $index)"
[class.selected]="item === currentItem">
{{ item.src }}
</li>
</ul>
...
I'm still learning Angular so please bear with me.