How do you create a link from a list?


#1

Hello,

I am a student and is new to Ionic. I want to create a settings page with a list when you click one of the items on the list you are directed to another page.

Thanks for all the help.


#2

From the docs: http://ionicframework.com/docs/components/#item-dividers

<div class="list">

  <div class="item item-divider">
    Candy Bars
  </div>

  <a class="item" href="#">
    Butterfinger
  </a>
  <a class="item" href="#">
    KitKat
  </a>


  ...

</div>

#3

What I am trying to get at is how do you create the way the new page is loaded once you tap the bar. The transition I already have the list.


#4

In your config, you’d have a state for the other page. The state should have a URL defined. The URL would go in your list.

...

.state('candy', {
    url : '/candy/:candyId',
    templateUrl : 'templates/candyTypes.html',
    controller : 'CandyController'
})

...
<div class="list">

  <div class="item item-divider">
    Candy Bars
  </div>

  <a class="item" href="#/candy/1">
    Butterfinger
  </a>
  <a class="item" href="#/candy/1">
    KitKat
  </a>

</div>