javascript - console.log() not showing in any browser in angular 6 project
问题描述
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
解决方案
在您的 index.html 中,<script src="https://scripts.sandbox.bka.sh/versions/1.0.0-beta/checkout/bKash-checkout-sandbox.js"></script>
这一行破坏了您的代码。因为在这个js中覆盖了console.log函数。如果您不使用,请删除此脚本。
推荐阅读
- c++ - 使用此合并排序代码运行时输出错误
- laravel - 如何在 laravel 中进行 crud 条目电子邮件批准
- matlab - 从数据集中选择一个维度的最大值
- python - 如何对具有相同值的行进行分组?
- php - Fail to pass a boolean value through a SQL request
- c# - 我可以在一行中修改属性的属性吗?
- python-3.x - 在 Python 中裁剪并仅从图像中选择检测到的区域
- javascript - 如何将匿名函数传递给 Jquery 的点击处理程序
- mysql - Laravel - 通过另一个模型的功能从模型中过滤行
- openedge - 尝试编写连接到排序浏览器的查询