Reputation: 2083
How do I do something like this on a template view?
Example:
{{ field.replace(/ \d*/, "") }}
Where field is a string..
Upvotes: 1
Views: 561
Reputation: 193261
You can't use regular expression literals in angular expressions (see docs). It means that the closest you can get is creating a regexp object in controller
$scope.regexp = / \d*/;
and then use it in template:
{{ field.replace(regexp, "") }}