Praveen JP
Praveen JP

Reputation: 105

How to show array data in page using angularJs

i want show array data in view page using angularjs and ionic.

Here is my category controller output array format:

["Mouse", "Keyboard"]

Here is view code:

<span ng-repeat="cat in category track by $index">
   <ion-item ui-sref="home.add" href="#">
      <h2 class="list-text">{{cat.data}}</h2>
   </ion-item>
</span>

Please help me to find out the problem.

Thank You.

Upvotes: 0

Views: 71

Answers (1)

Anik Islam Abhi
Anik Islam Abhi

Reputation: 25352

Try like this

<span ng-repeat="cat in category track by $index">
   <ion-item ui-sref="home.add" href="#">
      <h2 class="list-text">{{cat}}</h2>
   </ion-item>
</span>

Upvotes: 4

Related Questions