2016-02-27 47 views
0

我有一個以下JSON數據列表數組列表內由AngularJS數組列表的對象屬性NG-repeat屬性

[Beds = [ 
    ElectricHospitalBed = [{name: 'Multifunctional electric hospital bed', code: 'IHC B/E 1001'}, 
     {name: 'Multifunctional electric hospital bed', code: 'IHC B/E 1002'}, 
     {name: 'Five functional electric hospital bed with ACP', code: 'IHC B/E 1003'}, 
     {name: 'Five functional electric hospital bed', code: 'IHC B/E 1004'}, 
     {name: 'Five functional electric hospital bed with ACP', code: 'IHC B/E 1005'}, 
     {name: 'Five functional electric hospital bed', code: 'IHC B/E 1006'}, 
     {name: 'Three functional electric hospital bed', code: 'IHC B/E 1007'}, 
     {name: 'Three functional electric hospital bed', code: 'IHC B/E 1008'}, 
     {name: 'Five functional electric hospital bed', code: 'IHC B/E 1009'}], 
    Semi electric hospital bed = [], 
    Manual hospital bed = [], 
    Home care bed = [], 
    Orthopedics bed = [], 
    Childrens bed] = [], 
Trollies = [Patient trolley = [], 
    Stretcher = [], 
    Nursing trolley [], 
    Cambered trolley=[]] 
] 

我必須列出給定的每一個對象的是產品的所有名稱(一個產品)通過AngularJS ng-repeat屬性。請指教。

注意:此JSON數據被分配給名爲ProductsData的控制器中的名爲變量的變量。

+0

數據正確,張貼有效的一個 –

+0

做標記爲已回答一旦解決(: – yUdoDis

回答

1

是像[Beds = [{},{}],[{},{}],[{},{}], Trolleys = [],[],[],]

<div ng-repeat="c in products"> 
    <div ng-repeat="p in c"> 
    {{c.name}} 
    </div> 
</div> 

c的類別產品,即牀,手推車等

p是在每個類別項目,

和c.name應該得到你所需要的。

0

糾正你的json格式問題。

反正我改變什麼,你提供了其在沒有有效的JSON format.can你jsbin implimented here

+0

遺憾的JSON格式 –

相關問題