S
S
Sergey2015-11-08 15:28:59
Angular
Sergey, 2015-11-08 15:28:59

Displaying html tag in angular expression?

There is a code:

<td>{{allTags[task.tag] || "ID \""+task.tag+"\" не найден в доступных тегах"}}</td>

This brings everything out right.
<td>{{allTags[task.tag] || "<b>ID \""+task.tag+"\" не найден в доступных тегах</b>"}}</td>

Displays krakozyabra. How to output html?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
L
lega, 2015-11-08
@Sergamers

You cannot create child elements inside a "physical" text node.
You can do this:

<td>
  {{allTags[task.tag]}}
  <b ng-if"!allTags[task.tag]">ID {{task.tag}} не найден в доступных тегах</b>
</td>

S
Sergey, 2015-11-08
Protko @Fesor

1) why not take this tag out of the binding?
2) ng-bind-html

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question