How to click in list and show new page

Hi , I’m new to ionic and i want and want to know when you click on the list displays another page
Thanks !

Have a look at the starter project… this is a good place to start, and there is a demo link on the repo too.

1 Like

var malls = [
{ id: 0, name: ‘Mall’ , image:’#’,

    brands:[{        
      id:0,  name:'Nike',  percent:'30%'
    
   ]};

]};

something wrong ? please its not work

I don’t think there’s enough code, or detail as to your problem. Are you able to put up a codepen please?

1 Like


Please i want when click (mall) I show brand.marque
Thanks u

OK, so you have a few typos and need to access the right JSON parts… you prob want this (in your friend-detail.html), if you just want Nike to be shown in your example.

<ion-view title="{{friend.brands[0].marque}}">

But really I think you need to take a few steps back and get the Angular type basics first.

if I want to display the list for the variable (brand) on the templette (friend-detail)
how ?
Thank u so much to answer me

i want show list dynamic in templette (friend-detail
)

Can you explain what you mean by “List for the variable”?

information the variable brands

So you have this in your services;

    brands:[{
    id:0,
    marque:'Nike',
    percent:'20%'

}] 

I have shown you above how to show Nike in the title, are you now asking about how to show 20%? If you can give more information, or an example, that would be helpful.

I want to do in each list had to listen when I Clicque (mall) I display the brand list

var friends = [
{ id: 0, name: ‘Mall’,lastname:‘achraf’,

brands:[{
    id:0,
    marque:'Nike',
    percent:'20%'

}] 

},

I’m afraid I still don’t get it.
Would you say, for example, have a brands variable like this?

brands:[
  {
    id:0,
    marque:'Nike',
    percent:'20%'
  },
  {
    id:1,
    marque:'Dunlop',
    percent:'30%'
  },
]

And want to display something like this?

  • Nike: 20% off
  • Dunlop: 30% off

yes like this , and when i click in mall i show two this information brands

Well your friend scope item has these in… and you’re pretty close. As per my previous reply relating to the title you aren’t accessing the data quite correctly.

Try this;

    <a class="item item-thumbnail-left" ng-repeat="brand in friend.brands"  href="#">
    <h2>{{brand.marque}}</h2>
  <p>{{brand.percent}}</p>

</a>

See here http://plnkr.co/edit/zfvgcWofOlrmxZM3nicH?p=preview

1 Like

Thaaaaaaank youuu sooo muccchhh my friend !