I have angular template showing list of items using ng-repeat which does a comparison between properties of the item.
I want the logic to stay in template and display the result right away, but the logic below throw error instead and fail angular to render.
Normal replace with single character works, but not with multiple characters.
<div ng-repeat="item in items">
<p>{{item.old_name}}</p>
<input ng-model="item.new_name">
<span>
{{item.old_name.replace(/ |_/g, '-') == item.new_name(/ |_/g, '-') ? "same" : "not same"}}
</span>
</div>
How to fix this?