user494461
user494461

Reputation:

How to style angular text blocks

I have a status var in a scope of a controller. Whenever my rest PUT succeeds I append a message to this js variable. I show it in my template using {{status}}

How can I style this? I tried inserting <br> tags in this text but they just show up as regular text and dont insert a new line. How can I also bold certain tag?

Upvotes: 2

Views: 443

Answers (3)

Yan Yang
Yan Yang

Reputation: 1974

Why not use a tag or a tag to wrap your {{status}}, and add to the tag an id or classes with styles?

Upvotes: 1

user3172446
user3172446

Reputation: 59

You can also take a look at https://docs.angularjs.org/api/ng/directive/ngClass

about ng-class directive

Upvotes: 1

Raghavendra
Raghavendra

Reputation: 5387

In order for HTML to be rendered, use ng-bind-html

<div ng-bind-html="status"></div>

P.S. Don't forget to import ngSanitize module into your app.

Upvotes: 1

Related Questions