Ionic date popup error

In ionic,when I am going back(other pages) in my application, the ion-date popup is also showing on that page, although there is no any date picker on back page

i didn’t get exactly what you want but this will hide date picker when ever you click outside

first add “openDatePicker(yourId)” in input,

make use of (document:click)

host: {
’(document:click)’: ‘onClick($event)’,

export class ClassName {


constructor(private _eref: ElementRef) { }

openDatepicker(id ){
this.dpId = id;
onClick(event) {
if(!this._eref.nativeElement.contains( {
let self = this;


Hi Macky, with this i am getting error can not read property ‘close’ of undefined.

sorry for late response but a glimpse on code will be help full.