Hello,
I was watching an ionic crash course video: https://www.youtube.com/watch?v=O2WiI9QrS5s&feature=youtu.be and I made exactly like the tutorial:
- Created a new page using
ionic g page noticia-completa
- Added this new page to
@NgModule
under: “declarations
” and “entryComponents
”. - Created a card list:
<ion-card *ngFor="let feed of feeds">
<img (click)="itemSelected(feed)" [src]="feed.img" />
<ion-card-content (click)="itemSelected(feed.url)">
<ion-card-title>
{{feed.post_title}}
</ion-card-title>
<p [innerHTML]="feed.post_excerpt" id="justify"></p><br/>
<span [innerHTML]="feed.post_date" class="data_e_hora"></span> - <span>{{feed.autor}}</span>
</ion-card-content>
</ion-card>
My .ts for clicking on the card is:
itemSelected (feed) {
this.navCtrl.push (NoticiaCompletaPage, {
feed: feed
});
}
This is my noticias-completa .html:
<ion-header>
<ion-navbar>
<ion-title>teste</ion-title>
</ion-navbar>
</ion-header>
<ion-content>
<div class="item-detail" padding>
<h2>teste</h2>
<p>teste</p>
</div>
</ion-content>
and for my .ts page:
import { Component } from '@angular/core';
import { NavController, NavParams } from 'ionic-angular';
@Component({
selector: 'page-noticia-completa',
templateUrl: 'noticia-completa.html',
})
export class NoticiaCompletaPage {
feed: any;
constructor(public navCtrl: NavController, public navParams: NavParams) {
this.feed = navParams.get ('feed');
}
ionViewDidLoad() {
console.log('ionViewDidLoad NoticiaCompletaPage');
}
}
The only thing I’m doing differently is that I’m using a side menu template instead of tabs. Whenever I open this new page, there is a back button on the navbar but it’s not working. If I use the Android back button I’m able to go back to the main page but the button that is created doesn’t.
EDIT: Is working only in iOS; This is causing I’m only being able to read one of the feed because whenever I go back and click on another card I get an error.
How can I fix it?
Thank you!