简体   繁体   English

Angular2“ BrowserDomAdapter”做什么?

[英]What does the Angular2 “BrowserDomAdapter” do?

该文件当前未在网站上记录: https//angular.io/guide/lifecycle-hooks

It's an abstraction of the DOM. 这是DOM的抽象。 It was mentioned several times that it is not intended to be used except internally in Angular2. 多次提到它不打算在Angular2中内部使用。

Because developers try to avoid direct DOM access they still use BrowserDomAdapter to get abstraction from the DOM to keep the code compatible with server-side rendering and with WebWorkers. 因为开发人员试图避免直接DOM访问,所以他们仍然使用BrowserDomAdapter从DOM中获取抽象,以使代码与服务器端呈现和WebWorkers兼容。 Some official statement about whether to use it or what to use instead is still missing as far as I know. 据我所知,关于是否使用它或使用什么代替的一些官方声明仍然缺失。 I think there are plans to provide "some" abstraction that is intended to be used outside Angular itself but it has yet to be carved out how that will look like ( BrowserDomAdapter or something else). 我认为有计划提供“某些”抽象,该抽象旨在在Angular本身之外使用,但尚未确定它的外观( BrowserDomAdapter或其他)。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM