0

I am getting response below that

myresponse

test: {
    "credit": {
        "1500000": [{
            "date": "2016-07-21",
            "balance": -1528750,
            "category": "Transfer out",
            "narration": "test1",
            "amount": -1500000
        },
        {
            "date": "2016-07-21",
            "balance": -1528750,
            "category": "Transfer out",
            "narration": "test1",
            "amount": -1500000
        }]
    },

html

<table class="table table-striped table-responsive table-bordered">                        
    <tr>
        <th class="text-center">Months</th>
        <th class="text-center">Data</th>
        <th class="text-center">Balance</th>
        <th class="text-center">Category</th>
        <th class="text-center">Narration</th>
        <th class="text-center">Amount</th>
    </tr>
    <tbody ng-repeat="my in myctrl.credit">
        <tr ng-repeat="(key, val) in my">
            <td></td>
            <td class="text-center">{{val.date}}</td>
            <td class="text-center">{{val.balance}}</td>
            <td class="text-center">{{val.category}}</td>
            <td class="text-center">{{val.narration}}</td>
            <td class="text-center">{{val.amount}}</td>
        </tr>
    </tbody>
</table>

I can get all values but i can't able to get in this 1500000 how can i get this

also i want to merge that month row

How can I achieve this?

1
  • i use {{key}} it will show 0 & 1 Commented Apr 12, 2017 at 18:38

1 Answer 1

3

Your ng-repeats are nested in the wrong order. Should be:

<tbody ng-repeat="(key, val) in myctrl.credit">
 <tr ng-repeat="data in val">
  //data has date, balance, etc
  //key = 150000
Sign up to request clarification or add additional context in comments.

4 Comments

What is not working exactly? What's the value of "key" and "val" respectively?
I want to get 150000 this
You said its not working. I ask, when you do this I told you, what's the value of key and val? Debug it.
Ya thanks how i merge that first td if both same value

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.