您好,我在 WordPress 网站上使用 AngularJS,当在我的部分 HTML 文件(例如 {{post.manualest}}
)中使用 Angular 标记显示自定义字段值时,它显示为 [ “1,500,000”]
如何删除 [""]
使其仅显示 1,500,000
?
最佳答案
由于 {{post.manualest}}
包含一个您需要 ng-repeat
<p ng-repeat="tag in post.manualest">{{tag}}</p>
The ngRepeat directive instantiates a template once per item from a collection. Each template instance gets its own scope, where the given loop variable is set to the current collection item, and
$index
is set to the item index or key.
关于javascript - 从 JSON 值中删除括号和引号,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35284293/