How can I write data attributes using Angular?
Use attribute binding syntax instead
<ol class="viewer-nav"><li *ngFor="let section of sections" [attr.data-sectionvalue]="section.value">{{ section.text }}</li> </ol>
or
<ol class="viewer-nav"><li *ngFor="let section of sections" attr.data-sectionvalue="{{section.value}}">{{ section.text }}</li> </ol>
See also :
About access
<ol class="viewer-nav"> <li *ngFor="let section of sections" [attr.data-sectionvalue]="section.value" (click)="get_data($event)"> {{ section.text }} </li> </ol>
And
get_data(event) { console.log(event.target.dataset.sectionvalue)}