0

repeat inside ng-repeat.

<li ng-repeat="(key,value) in OauthSwaggerData.paths " > 
    <div class="col col-100">{{key}}</div>   
    <div ng-repeat="APIDetails in OauthSwaggerData.paths['/key']">
        <div class="col col-100"><h4>Summary</h4> </div>
        <div class="col col-100">{{APIDetails.summary}}</div>
        <div class="col col-100"><h4>Description</h4> </div>
        <div class="col col-100">{{APIDetails.description}}</div>
        <div class="col col-100"><h4>Parameters</h4> </div> 
    </div>
</li>

In the first line i want to display the keys which are available , which is working fine. In the second ng-repeat I want to pass the name of the key which i have selected. e.g.

<div ng-repeat="APIDetails in OauthSwaggerData.paths['/token']"> . 

When i hardcode this value i am getting the desired output. But i want to pass the "key " from the first loop in this second loop.

<div ng-repeat="APIDetails in OauthSwaggerData.paths['/key']"> 

which i not working fine.

Kindly help me to resolve the issue.

3
  • I tried <div ng-repeat="APIDetails in OauthSwaggerData.paths['/{{key}}']"> this also. Commented Mar 3, 2016 at 14:05
  • 2
    You want to do this: ng-repeat="APIDetails in value" ? Commented Mar 3, 2016 at 14:05
  • @BobSponge You saved my day dear. Thank you very much . I am so happy :) Commented Mar 3, 2016 at 14:10

2 Answers 2

2

In your third line try:

<div ng-repeat="APIDetails in OauthSwaggerData.paths['/' + key]">
Sign up to request clarification or add additional context in comments.

Comments

0

hope this help

<li ng-repeat="(key,value) in OauthSwaggerData.paths " > 
<div class="col col-100">{{key}}</div>   
<div ng-repeat="APIDetails in value">
    <div class="col col-100"><h4>Summary</h4> </div>
    <div class="col col-100">{{APIDetails.summary}}</div>
    <div class="col col-100"><h4>Description</h4> </div>
    <div class="col col-100">{{APIDetails.description}}</div>
    <div class="col col-100"><h4>Parameters</h4> </div> 
</div>

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.