Concatenate strings and variable values in angular html template

Just use the simple quotes ' and + sign inside the double quotes of the html attribute value. See the value of the href attribute below:

<div class="float-right mt-1">
    type="button" class="btn btn-light btn-sm float-right"
    href="mailto:?subject=Code snippet: &body="
    title="Share link to snippet via Email">
    <i class="far fa-envelope"></i> Email

Reference -

Shared with from Codever. 👉 Use the Copy to mine functionality to copy this snippet to your own personal collection and easy manage your code snippets.

Codever is open source on Github ⭐🙏

Subscribe to our newsletter for more code resources and news

Adrian Matei (aka adixchen)

Adrian Matei (aka adixchen)
Life force expressing itself as a coding capable human being

Mongoose schema field from list of strings (enum)

Mongoose schema field from list of strings (enum) code snippet Continue reading

Set value of input field in angular template

Published on December 14, 2022

How to use jest test.each function

Published on December 14, 2022