I am using Angular 2 and looking to set-up a page where the contents are displayed through an *ngFor
loop, and the body is displayed through a separate div. These use interpolation to display the objects relevant properties. I would like the content to link to the relevant div in the body.
To display the contents in the left hand side:
<div class = "contents">
<div *ngFor = "let disp of content">
{{disp.heading}}
</div>
</div>
To display the article on the right hand side
<div *ngFor="let disp of content>
{{disp.header}}
{{disp.body}}
<div>
This is similar to the query here Angular2 Routing with Hashtag to page anchor
However, as it is in an *ngFor
loop dependent on content, abd uses interpolation, I cannot see a way to identify different divs within the loops as these are provided dynamically.