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

How to send info through output?

$
0
0

I’m trying to send info through output, but nothing is recived.

I have a list of items (page 1), when an item is clicked a modal is launched, inside this modal there are categories, when one of this categories is clicked I have to send this value to the categories page (page 2).

When categories page will be loaded I have tho show the events who match with the category recived.

If I am right, the launched modal is the son, and the categories page is the father.

On modal html I have something like this:

<ion-row>
 <ion-col size="12">
  <ion-chip class="tab-selected">
   <ion-label (click)="goTo('/tabs/tab2',p.type)">{{p.type}}</ion-label>
  </ion-chip>
 </ion-col>
</ion-row>

The modal component looks like this:

import { Component, OnInit, Input, Output, EventEmitter } from '@angular/core';
.
.
.
@Output() clickType = new EventEmitter<string>();
.
.
.
goTo(url:string,category:string){
    this.router.navigateByUrl(url);
    console.log(category);
    this.clickType.emit(category);
    this.modalCtrl.dismiss();
  }

Category page html looks like this:

.
.
.
<ion-label class="left_titulo" (clickType)="Click($event)" text-wrap><h2>{{e.event}}</h2></ion-label>
.
.
.

Category page component looks like this:

.
.
.
Click(category:string){
 console.log('Category is: ',category);
}
.
.
.

When I click on the text from the ion-label, nothing is launched, not console.log, not even errors, anything!

Any help?

Thanks.

2 posts - 2 participants

Read full topic


Viewing all articles
Browse latest Browse all 49083

Trending Articles



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