kittencup / angular2-ama-cn

angular2 随便问
691 stars 101 forks source link

怎么在ng2的Directive里面获取到浏览器窗口的高度 #150

Open greper opened 8 years ago

greper commented 8 years ago

如题

Imporial commented 8 years ago

jQuery(window).height() 与JQuery配合使用,不用 $ 避免与 Angular2 可能的冲突,鄙人是这么做的

greper commented 8 years ago

后来我试了一下,可以直接在ts里面获取到window,然后直接拿窗口高度就行了