Quantcast
Channel: Ionic Framework - Ionic Forum
Viewing all articles
Browse latest Browse all 49230

Get a specific element of a list (Lazy Loading)

$
0
0

@Balints wrote:

Hi!

Can anyone help with this one?

list.html

<ion-list *ngFor="let homelist of homelists">
        <ion-list-header>
           {{homelist.headerName}}
        </ion-list-header>

        <button clear ion-item *ngFor="let homelistitem of homelist.items" (click)="itemClicked(homelistitem)">
            {{homelistitem.itemName}}
        </button>

    </ion-list>

list.ts

@IonicPage()
@Component({
  selector: 'page-list',
  templateUrl: 'list.html',
})
export class ListPage {
  homelists: any;
  itemInfo: any;



  constructor(
    public navCtrl: NavController,
    public navParams: NavParams,
    public menuCtrl: MenuController,
    public data: DataProvider) {

      this.itemInfo = this.navParams.data;
      this.menuCtrl.enable(true, 'myMenu');

  }

  ionViewDidLoad(){
    this.homelists = this.data.lists;
}

  itemClicked(item):void {
    this.navCtrl.push('InfoPage', item);
}

I’ve used this for starters: https://www.youtube.com/watch?v=9c_98PcDg0o&t=1327s

My question is: how can i push directly to a selected itemName’s infopage?

-let’s say I have a ContactsPage and want to navCtrl.push to a specific item on the list (which is lazy loaded).

Posts: 1

Participants: 1

Read full topic


Viewing all articles
Browse latest Browse all 49230

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>