簡體   English   中英

Tslint Angular:不允許使用窗口

[英]Tslint Angular: Usage of window is not allowed

我需要在Angular應用程序中打印頁面之一,所以我遇到了類似以下情況:

myPage = window.open();
myPage.Print();

問題是我從tslint收到以下錯誤:

“不允許使用窗戶”

我在這里/其他解決方案中找到了一些答案,例如: https : //brianflove.com/2018/01/11/angular-window-provider/

但它們都使用在某些時候window

 return window;

然后我將再次收到錯誤消息"Usage of window is not allowed"

我該如何解決?

謝謝。

所以我解決了它,而不是這樣做myPage = window.open(); , 做就是了:

myPage = open(); 

相反...

非常簡單。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM