JADE使用HTML和JSON渲染角度范围var

时间:2014-05-16 04:46:26

标签: javascript json node.js angularjs

我有一个angualrjs var,它是带有JSON的HTML,它基本上是从数据库中读取的。

var是

    <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"}}'>&nbsp;</span></div> 

现在如果我只使用{{varname}}它会显示带有标签的html,但它没有正确呈现它

我试过了!=和!并且=没有运气

我的Nodejs服务器是:

    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);
    });

有谁知道如何正确渲染它?

1 个答案:

答案 0 :(得分:0)

我无法发表评论,但你检查过这个可能的重复吗?

How to make Jade stop HTML encoding element attributes, and produce a literal string value?