I have a angualrjs var which is HTML with JSON, it basically read from the database.
The var is
<div id='tes-34ncd' class='classname'><span class='classname-data' title='{"id":"34f3fgg","server":"www.example.com","geometry":{"width":470,"height":"infinite"},"configuration":{"newEntryLocation":"top","commentLocation":"top","replayContentOrder":"chronological","pinsGrowSize":"on","titlePage":"off","skinOverride":"117"}}'> </span></div>
Now if I just use {{ varname }} it shows the html with tags, it doesn't properly render it
I have tried with != and ! and = and no luck
My Nodejs server is:
app.configure(function(){
app.set('views', __dirname + '/views');
app.set('view engine', 'jade');
app.set('view options', {
layout: false
});
app.use( express.cookieParser() );
app.use(express.favicon());
app.use(express.json());
app.use(express.urlencoded());
app.use(express.methodOverride());
app.use(express.static(__dirname + '/public'));
app.use(app.router);
});
Does anyone know how to render it properly?
I can't comment but have you checked this possible duplicate out?
How to make Jade stop HTML encoding element attributes, and produce a literal string value?
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.