我正在尝试使用AngularJS 1.1.5和PHP构建一个推荐网站
我有一个由Name,Message和Date组成的JSON对象数组.
真实的推荐将是Message属性,并且在推荐书中会有换行符.
[ { "Name": "Snow White", "Message": "Dear all, I need a new line
Is it possible to do it in AngularJS?", "Date": "16/11/2013" }, { "Name": "Cinderalla", "Message": "Dear all, I need a new line
Is it possible to do it in AngularJS?", "Date": "10/11/2013" }, { "Name": "Ariel", "Message": "Dear all, I need a new line
Is it possible to do it in AngularJS?", "Date": "20/06/2013" } ]
在使用$ resource获取数组并将其链接到$ scope.Ctestimonials之后,我使用ng-repeat将所有对象渲染到HTMl上.
{{testimonial.Message}}{{testimonial.Name}}, {{testimonial.Date}}
但是,我无法在html页面中正确呈现换行符.有谁知道我该怎么做?
谢谢