Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/json/15.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
ng重复指定一次json格式_Json_Angularjs_Angularjs Ng Repeat - Fatal编程技术网

ng重复指定一次json格式

ng重复指定一次json格式,json,angularjs,angularjs-ng-repeat,Json,Angularjs,Angularjs Ng Repeat,在HTML中: <div class="field" ng-repeat="field in fields "> <strong>{{field.fieldName | json}}: {{field.itemCount | json}}</strong> <p ng-switch="field.type"> <p ng-switch on="NUMBER"> {{field.numberStats |

在HTML中:

<div class="field" ng-repeat="field in fields ">
    <strong>{{field.fieldName | json}}: {{field.itemCount | json}}</strong>
    <p ng-switch="field.type">
    <p ng-switch on="NUMBER">
    {{field.numberStats | json}}
    </p>
  </p>
</div>

{field.fieldName | json}:{{field.itemCount | json}}

{{field.numberStats | json}

有没有一种方法可以在某个地方只指定一次
| json
,并正确计算表达式


非常感谢

json
过滤器也不是样式问题的解决方案。更好地重新定义html结构,作为快速修复,尝试将所有
更改为
而且您的标记不正确,
标记无法嵌套

首先需要使用
json
过滤器吗?您通常只使用它来显示数组或对象,而不是基本体,但我需要在这里显示对象本身的对象属性。。。field.numberstats是{“max”:1389691379,“mean”:1320206780,“min”:1389691322,“sum”:26404135609},没有
|json
它不适合div容器在一些地方有
|json
真的是个问题吗,当我不得不多次使用同一条命令时,它只是敲响了警钟。如果你打算显示json,那么你需要使用它。任何替代方案都需要类似的复制感谢您的澄清,但没有任何变化