$ document和$ window之间有什么区别?

时间:2015-02-18 20:00:47

标签: angularjs

这是我的问题,我正在使用AngularJS,我需要知道$document$window之间有什么区别,因为我正在做一些我需要根据屏幕分辨率工作的指令,所以在开始定义指令必须调用的位置之前,我需要针对一些不同的点。

1 个答案:

答案 0 :(得分:1)

它与JavaScript中windowdocument个对象之间的差异相同。 window是可见部分,因此您可能应该使用它。

What is the difference between window, screen, and document in Javascript?