angularjs - 在对象中创建对象数组 - Node.js

标签 angularjs node.js angular

在下面的代码中,“info”对象有描述、数量、值。如何将它们作为数组提供(Indo 属性)。如何以 Angular 代码检索。

details.customsDetail.itemDetails = {
                    currency : "2000USD",
                    weight : "lbs",
                    info : {                         
                        description : "descr",
                        quantity : "2",
                        value : "124",              

                     }

            };

最佳答案

您的意思是,indo 属性作为对象数组吗?

details.customsDetail.itemDetails = {
                    currency : "2000USD",
                    weight : "lbs",
                    info : [{                         // How to give this in a array.
                        description : "descr",
                        quantity : "2",
                        value : "124",              

                     }]

            };

关于angularjs - 在对象中创建对象数组 - Node.js,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43269940/

相关文章:

http - 使用参数动态加载页面(Ionic 2 + Angular 2)

javascript - 仅将唯一的对象添加到数组中

javascript - Grunt复制/ Ant 模式/省略变量目录

javascript - JS函数原型(prototype)断章取义 Node 表达

angular cli build 将静态文件放在给定项目的/dist 的根目录中

angular - 多个 Guards 调用异步函数

json - 在 Ng-Table 上加载 JSON 数据后分页不起作用

javascript - 如何使用当前选定的文件检查数组中的属性?

node.js - ionic - 错误 : Cannot find module 'gulp-sass'

php - 在 Nginx 和 Ubuntu 服务器上设置 PHP