node.js - Allowing HTML Tags within JSON for Display -
i'm new angular, 3 decades of development experience. i'm missing simple, hope.
everything works great, notice in "current owner mailing address" has html break, when displays on page, see html tag, not expected break in text. how can around this? i'm not having luck finding information around it.
i have following in component.ts:
public madata = { "groupdata": [ { "title" : "public records", "datapoints" : [ {"label" : "current owner", "value" : "john smith"}, {"label" : "current owner mailing address", "value" : "123 fl highway 218<br/>middleburg, fl 32068-0000"}, {"label" : "loan recording date", "value" : "04/10/2015"}, {"label" : "loan borrower name", "value" : "john smith"}, {"label" : "concurrent sale date", "value" : ""}, ]}, ]
}
my html looks this:
<div name="float_group" style="order:6" class="float group" *ngfor="let ld of madata.groupdata"> <div class="header groupchar"> {{ld.title}} </div> <div class="data"> <div class="contentrow" *ngfor="let dp of ld.datapoints"> <div class="labeltext"> {{dp.label}} </div> <div class="valuetext"> {{dp.value}} </div> </div> </div> <div class="footer groupchar"></div> </div>
this poc , angular learning exercise me. next steps tie soap services generate these json response, have control of how used, ui has show in multiple lines.
use innerhtml
:
is used when interpreting value html
<div class="valuetext" [innerhtml]="dp.value"></div>
Comments
Post a Comment