I have the following markup that shows a value from ng-model:
<a ng-click="downloadDocument()">{{document.content.replace(/\d+\_/,"")}}</a>
Before each document.content
I add a number and an underscore, something like "12122141_document.txt"
. I want to replace this part by using the regex /\d+\_/
.
This throws an error in AngularJS, although {{ document.replace(" ","") }}
works.
Is the only way to solve this a directive or am I doing something wrong?