0

This is an ongoing angular OTA project. All the logging worked before, until suddenly they stopped working. None of the previously written console.log are outputting anything in the browser console.

ngOnInit() {
    console.log('Hiiiii');
    this.imgUrl = this.allapi.imageUrl;
    this.journeyType = JSON.parse(sessionStorage.getItem('journeyType'));
    this.bookingData = JSON.parse(sessionStorage.getItem('payload'));
    if (this.bookingData.FareBreakdown.length > 0) {
      this.fareBreakDown = this.bookingData.FareBreakdown;
    } else {

    }
    this.calculateLayover();

    sessionStorage.setItem('promoApplied', JSON.stringify(this.promoApplied));

    if (this.journeyType == 3) {
      this.layover_multi = JSON.parse(sessionStorage.getItem('layoverMulti'));
      this.multiCityPlaces = JSON.parse(sessionStorage.getItem('multi_places_list'));
    }
    this.getFareBreakDown();
  }

In the ngoninit() the first console.log is not showing any output in the browser.

stackblitz link: https://stackblitz.com/edit/angular-5pvvrq

4

2 回答 2

3

在您的 index.html 中,<script src="https://scripts.sandbox.bka.sh/versions/1.0.0-beta/checkout/bKash-checkout-sandbox.js"></script>这一行破坏了您的代码。因为在这个js中覆盖了console.log函数。如果您不使用,请删除此脚本。

https://angular-8vvejy.stackblitz.io/

于 2019-05-14T07:00:27.593 回答
2

确保在默认级别检查信息

在此处输入图像描述

于 2019-05-14T05:19:47.187 回答