In my Angular application, I am trying to display file name from complete file path.
<ng-template kendoGridCellTemplate let-dataItem="dataItem">
<a style="text-decoration: underline !Important;" href="javascript:void(0)" (click)="downloadFile(dataItem)">{{dataItem.file.replace(/^.*[\\\/]/, '')}}</a>
</ng-template>
dataItem.file.replace(/^.*[\\\/]/, '') works when I use in component class but fails in html with interpolation.
I get error as:
Parser Error: Unexpected token / at column 35 in [{{dataItem.file.replace(/^.*[\\\], '')}}] in ng:///AppModule/MyComponent.html@24:130 ("-decoration: underline !Important;" href="javascript:void(0)" (click)="downloadFile(dataItem)">[ERROR ->]{{dataItem.file.replace(/^.*[\\\], '')}}</a>
Is there anything wrong with this line in the interpolation ? Any pointers ?
{{dataItem.file.replace(/^.*[\\\/]/, '')}}