Hello i want to open a new page when i click on a cardview in my app.
What i have atm is this:
<ion-col width-50>
<ion-card class="card-width-marginright" type="button" ng-click="music()">
<img class="filter" src="assets/img/music.png"/>
<div class="card-title">Music</div>
<div class="card-subtitle">2 Subcategories</div>
</ion-card>
</ion-col>
and in my ts i have this:
music()
{
alert('Hello');
}
nothing really happens. what did i wrong?
Sloved it by myselfe.
html looks now like:
<ion-col width-50>
<ion-card class="card-width-marginright" type="button" (click)="music()">
<img class="filter" src="assets/img/music.png"/>
<div class="card-title">Music</div>
<div class="card-subtitle">2 Subcategories</div>
</ion-card>
</ion-col>
And my ts looks now like:
import { Component } from '@angular/core';
import { NavController } from 'ionic-angular';
import { Profile } from '../Profile/Profile';
@Component({
selector: 'page-Explore',
templateUrl: 'Explore.html'
})
export class Explore {
constructor(public navCtrl: NavController) {
}
music()
{
this.navCtrl.setRoot(Profile)
}
}
1 Like