Try to search your question here, if you can't find : Ask Any Question Now ?

In angular, how to add a class using the brackets?

HomeCategory: stackoverflowIn angular, how to add a class using the brackets?
Avatarcraig asked 2 weeks ago

Is it possible to create something like below?

<div *ngFor="let post of posts">
  <p class="quote {{post.color}}-quote">
    {{ post.content }}
    <span class="author">Anatoly Weinstein, Founder of Theora</span>
  </p>
</div>

Important line: class="quote {{post.color}}-quote"

I’ve seen similar issues, but I don’t want to use booleans and hardcode every element.

1 Answers
Best Answer
AvatarJyoti answered 2 weeks ago
Your Answer

7 + 13 =

Popular Tags

WP Facebook Auto Publish Powered By : XYZScripts.com