Uncaught TypeError: Cannot read property 'hasAttribute' of undefined


#1

when I try to press one of my hot deals this is error shown

when I searched for this error all results belonged to sliders in ionic but I didn’t use sliders on this page
I’m using ionic 3/ angular 4
I solved this issue many times later but it was because of sliders.

here is my HTML

<ion-header>
 <ion-navbar class="main-nav">

  <button class="main-nav-button" ion-button  menuToggle>
   <ion-icon name="menu"></ion-icon>
  </button>

  <ion-title>HC Mall Hot Sales</ion-title>

 </ion-navbar>
</ion-header>
<ion-content>
 <p id="separator">Ongoing Promotions</p>
 <ion-spinner class="promo-spinner" id="promospinner"></ion-spinner>
 <ion-card  class="promo-card" *ngFor="let seller of promosCurrent">
    <ion-item (click)="gotoGuideView($event,seller)">
        <ion-avatar item-left>
            <img src={{seller.img}}/>
        </ion-avatar>
        <p class="discount" item-right primary><b>{{seller.discount}}</b>
        </p>
        <h2>{{seller.name}}</h2>
        <p>{{seller.address}}</p>
        <p style="color:green"><b> On until {{seller.end*1000 | 
           date:'dd-MM-yyyy'}}</b></p>
   	</ion-item>
    <img (click)="gotoGuideView($event,seller)" src={{seller.img}}/>
    <ion-card-content>
        <p style="text-align:justify;">{{seller.content}}</p>
    </ion-card-content>
    <ion-col text-right>
    <button (click)="sharing($event,seller)"  ion-button clear small 
      color="primary" icon-left>
      <ion-icon name='share-alt'></ion-icon>
      Share
    </button>
  </ion-col>
  </ion-card>
   <p id="separator">Past Promotions</p>
   <ion-spinner class="promo-spinner" id="cpromospinner"></ion-spinner>
  <ion-card  class="promo-card" *ngFor="let seller of promosPast">
    <ion-item (click)="gotoGuideView($event,seller)">
        <ion-avatar item-left>
            <img src={{seller.img}}/>
        </ion-avatar>
        <h2>{{seller.brand}}</h2>
        <p>{{seller.address}}</p>
        <p style="color:maroon"><b> Expired {{seller.end*1000 | 
           date:'dd-MM-yyyy'}}</b></p>
   	   </ion-item>


    <img (click)="gotoGuideView($event,seller)" src={{seller.img}}/>
    <ion-card-content>
        <p style="text-align:justify;" >{{seller.content}}</p>
    </ion-card-content>
    <ion-col text-right>
    <button (click)="sharing($event,seller)"  ion-button clear small 
       color="primary" icon-left>
      <ion-icon name='share-alt'></ion-icon>
      Share
    </button>
  </ion-col>

this is my ts file

import { Component } from '@angular/core';
import { IonicPage, NavController, NavParams, Loading } from 'ionic-
   angular';
import { API } from '../../providers/api';

import { ProfilePage } from '../profile/profile';

@IonicPage()
@Component({
selector: 'page-promolist',
templateUrl: 'promolist.html',
})
export class PromolistPage {
public promosCurrent: any= [];
public promosPast: any= [];
public promosloaded: any =false;
public promopastloaded: any =false;
public loading: any;

constructor(public nav: NavController, public navParams: NavParams, public 
 api: API) {
  this.api.addingpromo(this.promosCurrent, this.promosPast);
  console.log(this.promosCurrent);
  console.log(this.promosPast);
 }

 gotoGuideView(event,seller){
  this.nav.push(ProfilePage, {
  seller: seller
 });
  console.log(seller);
 }

 sharing(event,item){
  this.api.share(item);
 }
}

this my API function

addingpromo(current, past){

 firebase.database().ref('promotions').orderByChild("end").once('value').then(function(snapshot){
   snapshot.forEach(
    function(childSnapshot){
      console.log(new Date().getTime());
        if (new Date().getTime()/1000< childSnapshot.val().end && new Date().getTime()/1000> childSnapshot.val().start){
            current.push(childSnapshot.val());
        }
        else if(new Date().getTime()/1000> childSnapshot.val().start){
          past.push(childSnapshot.val());
      }
    });
    document.getElementById("promospinner").style.display = "none";
    document.getElementById("cpromospinner").style.display = "none";
  });

}