Hey,
How can I call a function (defined in my HomePage) in a directive?
This is my directive :
import [...]
import { BattlePage } from '../../pages/battle/battle';
@Directive({
selector: '[absolute-drag]'
})
export class AbsoluteDrag {
constructor(...) { }
handlePan(){
[...]
// Where I want to call the function
}
}
This is my Home script :
import { Component, ViewChild, trigger, transition, state, style, animate, keyframes } from '@angular/core';
import { IonicPage, NavController, NavParams } from 'ionic-angular';
@IonicPage()
export class BattlePage {
constructor(public navCtrl: NavController, public navParams: NavParams) {}
// The function I want to call
rollDice( ) { ... }
}
Thank you!