2016-10-19 7 views
0

以下のようにJsonのリクエストがあります。私はテーブルのintrstedとキーの値だけをフィルタリングする必要があります。私は新しいフィルタと角度のキーを処理しています。 JSONリクエストとレスポンスを添付しました。アシナンが必要です。対応するオブジェクトキーの角度フィルタ

JSON:

var customer = 
[ 
    [ 
    { 
     "businessuserid": 44, 
     "businessusername": "rk business New", 
     "businessusermobile": "00", 
     "businessusercountrycode": "91", 
     "admin": true, 
     "mobilevalidated": false, 
     "emailvalidated": false, 
     "email": "[email protected]", 
     "upin": "000044" 
    } 
    ], 
    [ 
    { 
     "approved": true, 
     "businessuserid": 43, 
     "businessusername": "Cakey Bakes", 
     "businessusermobile": "8050663763", 
     "businessusercountrycode": "91", 
     "admin": true, 
     "mobilevalidated": true, 
     "emailvalidated": false, 
     "email": "[email protected]", 
     "upin": "000043" 
    } 
    ], 
    [ 
    { 
     "intrsted": true, 
     "attended": false, 
     "businessuserid": 44, 
     "businessusername": "rk business New", 
     "businessusermobile": "00", 
     "businessusercountrycode": "91", 
     "admin": true, 
     "mobilevalidated": false, 
     "emailvalidated": false, 
     "email": "[email protected]", 
     "upin": "000044" 
    } 
    ], 
    [ 
    { 
     "intrsted": true, 
     "attended": false, 
     "businessuserid": 52, 
     "businessusername": "Cars workshop", 
     "businessusermobile": "9535000636", 
     "businessusercountrycode": "91", 
     "admin": true, 
     "mobilevalidated": true, 
     "emailvalidated": false, 
     "email": "[email protected]", 
     "upin": "000052" 
    } 
    ] 

HTML:

<table ng-repeat="item in customers | filter: { intrsted: true }"> 
    <td>{{item.businessusername}}</td> 
    <tr> 
</table> 

答えて

1

あなたのフィルターの使用と間違って何もありません。問題はng-repeatです。 jsonオブジェクトを再度チェックすると、すべてのアイテムが別の配列であることがわかるので、配列として内部オブジェクトを使用する必要があります。

UPDATE

...あなたは アイテムはちょうど別の配列ので、[0]の項目のようにそれを使用すると、あなたが望む結果を得るでしょうがわかり、この

<table ng-repeat="item in customers | filter: { intrsted: true }"> 
    <td>{{item[0].businessusername}}</td> 
</table> 

のようなあなたのhtmlを修正今の第1、第2のNG・リピートの内リピートngのHTMLの使用上の内側の配列リストを示すため

...

<table ng-repeat="item in customers | filter: { intrsted: true }"> 
    <td ng-repeat="customer in item">{{customer.businessusername}}</td> 
</table> 
+0

I 1つの配列を持ちます。それが複数の場合は、どのように項目[1]に動的に値を設定できますか? –

+0

チェックアウトの更新セクション... –

+0

ありがとうございました –

関連する問題