我有:
businesses: [
{businessName: 'A', "address":[loc1, loc2, loc3]},
{businessName: 'B', "address":[loc1, loc2]},
{businessName: 'C', "address":[loc1]}
};
我想用输出重复这个对象:
A | street, city, zip, state
A | street, city, zip, state
A | street, city, zip, state
B | street, city, zip, state
B | street, city, zip, state
C | street, city, zip, state
换句话说,我想在带有 ng-repeat 的表格中将此对象显示为平面。
我必须自己将其展平,还是 ng-repeat 有能力做到这一点?
理想情况下,我可以做类似的事情
ng-repeat business in businesses
business.businessName | business.address.City | business.address.State
通过指定地址,它应该知道我想要它们。
否则,我如何扁平化这样的对象?
谢谢!