我正在用将使用localstorage的TypeScript编写一个Angular 2服务。我想将浏览器window对象的引用注入到我的服务中,因为我不想引用任何全局变量,比如Angular 1.x $window。
localstorage
window
$window
我该怎么做?
https://stackoverflow.com/questions/34177221
相似问题