小编lok*_*anx的帖子

Angular2 - 如何将窗口注入angular2服务

我在TypeScript中编写了一个Angular2服务,它将使用localstorage.我想将浏览器窗口对象的引用注入我的服务,因为我不想引用任何全局变量.像角1.x的localstorage.我怎么做?

dependency-injection typescript angular

107
推荐指数
12
解决办法
9万
查看次数

标签 统计

angular ×1

dependency-injection ×1

typescript ×1