1
myCtrl.Data.summary.account

if i print above model i get the output like below

["1","2","3","4","5"]

i want to use ng-repeat on this value, how to achive this?

I tried following code snippet using ng-repeat but it's not printing anything

<td ng-repeat="data in myCtrl.Data.summary.account">
    <tr>{{data}}</tr>
</td>

What mistake i made here? can anyone please point out this issue. How to fix this?

2
  • post myCtrl.Data Commented Mar 8, 2017 at 8:12
  • did you define controllerAlias as myCtrl? Commented Mar 8, 2017 at 8:13

4 Answers 4

1

it is ng-repeat not ng-repet

<td ng-repeat="data in myCtrl.Data.summary.account">
    <tr>{{data}}</tr>
</td>
Sign up to request clarification or add additional context in comments.

Comments

1

1) Use ng-repeat instead of ng-repet

2) If you are using controllerAs syntax check if myCtrl is correct controller name in controllerAs value

3) If you are using $scope then you should create $scope.myCtrl.Data.summary.account in controller

Comments

0

You should place the value in the columns and repeat for the rows. Your code should be in this format:

<tr ng-repeat="data in myCtrl.Data.summary.account">
    <td>{{data}}</td>
</tr>

Comments

0

angular.module("app",[])
.controller("ctrl",function($scope){
	$scope.arr = ["1","2","3","4","5"]
})
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.2.23/angular.min.js"></script>
<div ng-app="app" ng-controller="ctrl"> 
<table>
  <tr>
    <td ng-repeat="data in arr"> 
      <table>
        <tr>
          <td >{{data}}
          </td>
        </tr>
      </table> 
    </td>
  </tr>
</table> 
</div>

cant use directly <tr>inside <td> . you need to create a table and add it there

<td ng-repeat="data in myCtrl.Data.summary.account">
    <table>
        <tr>
            <td>{{data}}
            </td>
        </tr>
    </table>
</td>

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.