javascript - 从 JSON 值中删除括号和引号

标签 javascript jquery angularjs json angularjs-directive

您好,我在 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.

https://docs.angularjs.org/api/ng/directive/ngRepeat

关于javascript - 从 JSON 值中删除括号和引号,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35284293/

相关文章:

jquery - 使用jQuery改变angularJS树根节点的css样式

javascript - 某些 Android 设备中在线流媒体播放的音频编码问题

javascript - 如何在 <select> 元素上更改的 selectedIndex 上绑定(bind)事件?

javascript - 我可以在 Javascript/jQuery 中使用变量作为键吗?

jquery click 函数只工作了一半

javascript - AngularJS 中的自定义和标准多个过滤器

javascript - 将元素添加到现有的 jQuery 集中

javascript - 使用 for 循环调用变量名称(带/数字)

jQuery 仅在移动 CSS 加载时运行?

java - 如何将 Spring MVC 与 AngularJS ui-router 一起使用?