为什么Angular教程第8步中没有打印换行符?

时间:2016-07-18 07:37:37

标签: javascript html angularjs newline

我一直在阅读Angular Tutorial。在phones.json文件中,第一个对象为:

{
        "age": 0, 
        "id": "motorola-xoom-with-wi-fi", 
        "imageUrl": "img/phones/motorola-xoom-with-wi-fi.0.jpg", 
        "name": "Motorola XOOM\u2122 with Wi-Fi", 
        "snippet": "The Next, Next Generation\r\n\r\nExperience the future with Motorola XOOM with Wi-Fi, the world's first tablet powered by Android 3.0 (Honeycomb)."
    }

snippet属性中有两个换行符。所以我希望在文本The Next, Next Generation之后用两个换行符打印输出。但是有两个换行符,显示了两个whitespaces。您可以在此处查看输出:http://angular.github.io/angular-phonecat/step-8/app/

  
      
  • 为什么输出中没有打印换行符?

  •   
  • 如果新行无法在html中打印,那么json数据中/r/n的目的是什么?

  •   

P.S:我不知道我的问题是如何重复链接的。

0 个答案:

没有答案