Tslint Angular:不允许使用窗口

问题描述 投票:1回答:1

我需要在我的Angular应用程序中打印其中一个页面,所以我有类似的东西:

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

问题是我从tslint得到以下错误:

“不允许使用窗口”

我在这里看了一些回答/其他解决方案,例如:https://brianflove.com/2018/01/11/angular-window-provider/

但他们都在某些时候使用window

 return window;

然后我会再次收到错误消息qazxsw poi。

我该如何解决?

谢谢。

angular tslint
1个回答
0
投票

所以我解决了它而不是做"Usage of window is not allowed",只是做:

myPage = window.open();

相反......

非常容易。

© www.soinside.com 2019 - 2024. All rights reserved.