Yasser B.
Yasser B.

Reputation: 835

How to make routing pages with Angular JS using ionic framework

I'm new to both of Ionic framework and angular js which I find really helpful.

I'm stuck with a tiny problem. I'm not able to make routing pages. I just wanna link two pages dynamically.

on the first page I have a list of friends using ng-repeat.

when I click on a list item I want to show another page which contains all the details of the friend selected.

I was confused reading both of Angular js and Ionic documentation. so can you pease help with a simple code.

here is my code :

CODEPEN

<div ng-controller="MyCtrl"> 
  <ion-content> 
 <div class="list">

  <div class="item item-divider">
    Friends
  </div>

   <a class="item" href="#" ng-repeat="item in items">

        <h3>{{item.name}}</h3>

</a>   

  </div>
    </ion-cotent>
</div>

<script id="friend.html" type="text/ng-template">
      <view left-buttons="leftButtons" right-buttons="rightButtons" hide-back-button="true" title="'Awesome'">
        <content padding="true" has-header="true">
          <h1>Friend details</h1>
        </content>
      </view>
    </script>

Upvotes: 0

Views: 59

Answers (1)

Karan Kumar
Karan Kumar

Reputation: 2665

I edited your CodePen, have a look. Yes you were missing $state, as well as anuglar.config. I hope you get clear on how to use states and how to pass data between them.

CodePen

Upvotes: 2

Related Questions