0


I'd like to parse an json and print it on page with angular js. I could print array with ng-repeat directivie but there are nested arrays and couldn't print them properly. Here is the json with arrays;

   [{ 
        'adi':'serhat', 
        'adres':'Tuzla/İSTANBUL', 
        'telefon':[ {'numara':'(0216) 38343', 'dahili':['426']} ],
    },
    {
        'adi':'ali', 
        'adres':'Taksim/İSTANBUL', 
        'telefon':[{'numara':'(0212) 3893753','dahili':['2346','2220']}]
    }]

I would like to print the 'dahili' arrays. I could print them as a string with;

{{numarasi.dahili | json}}

But I want to print each item in array how can I do that? For example in a span tag.

1 Answer 1

2
    <table>
         <tr  ng-repeat="elem in numarasi">
              <td  ng-repeat="innerelem in elem.telefon">
                <span>{{innerelem.dahili}}</span>
              </td>
        </tr>
    </table>

Use ng-repeat.

Sign up to request clarification or add additional context in comments.

Comments

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.