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

Sourav Bhowmik
  • 21
  • 1
  • 1
  • 5

2 Answers2

3

In your index.html, <script src="https://scripts.sandbox.bka.sh/versions/1.0.0-beta/checkout/bKash-checkout-sandbox.js"></script> this line broke your code. Because override console.log function in this js. Remove this script if you dont use.

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

Muhammet Can TONBUL
  • 3,217
  • 3
  • 25
  • 37
  • Thanks a lot man ! It worked. Can you please explain, why this worked? – Sourav Bhowmik May 14 '19 at 07:36
  • If you review the contents of the ".js" file above, you will see that many functions of the "console" object are "overrided" in this file. For example, `console.log = function (args) { this.cacheargs = args; return null; } `. – Muhammet Can TONBUL May 14 '19 at 07:41
2

Make sure info is checked in default levels

enter image description here

Mindless
  • 2,352
  • 3
  • 27
  • 51