How can I use that regex in angularJs expression?

How can I use that regex in angularJs expression?

Here I have a string with spaces, and I would like to replace the space(s) to a single dash '-'.

Here I have a string with spaces, and I would like to replace the space(s) to a single dash '-'.

var card = "A World Elite Warrior";

console.log("card = " + card.toLowerCase().replace(/ /g,'-'));

The output is a-world-elite-warrior, but I just want to use it in the html template as a angularjs expression like this:

<img ng-src="images/cards/{{card.toLowerCase().replace(/ /g,'-')}}.png"

And it can not work, the error message is:

Error: [$parse:syntax] Syntax Error: Token '/' not a primary expression at column 61 of the expression


Angular 9 Tutorial: Learn to Build a CRUD Angular App Quickly

What's new in Bootstrap 5 and when Bootstrap 5 release date?

Brave, Chrome, Firefox, Opera or Edge: Which is Better and Faster?

How to Build Progressive Web Apps (PWA) using Angular 9

What is new features in Javascript ES2020 ECMAScript 2020

What are the best alternatives for angular js?

<img src="https://moriohcdn.b-cdn.net/193902114c.png">There are numerous frameworks and libraries used across the globe. If not angular, there are platforms like React, Vue, Aurelia and so on for app development.

Angular 8 Node & Express JS File Upload

In this Angular 8 and Node.js tutorial, we are going to look at how to upload files on the Node server. To create Angular image upload component, we will be using Angular 8 front-end framework along with ng2-file-upload NPM package; It’s an easy to use Angular directives for uploading the files.