0

I am trying to achieve this view by looping through 2 arrays enter image description here

but from the ng-repeats that I'm using, I get this view

enter image description here

This is the code that I have right now

$scope.properties = ["First name", "Last name"];

$scope.labels = ["john", "doe"];

//jade
.col-md-12
    .col-md-6(ng-repeat="property in properties")
        label {{ property }}
    .col-md-6(ng-repeat="label in labels")
            {{ label }}
0

1 Answer 1

1

Try this Use $index it will give the current index in properties array

HTML

 <div ng-repeat="prop in properties" class="col-md-12">
    <div class="col-md-6">
      <label>{{prop}}</label>
    </div>
    <div class="col-md-6">
      <label>{{labels[$index]}}</label>
    </div>
  </div>

JADE

.col-md-12(ng-repeat='prop in properties')
  .col-md-6
    label {{prop}}
  .col-md-6
    label {{labels[$index]}}
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.