看英文文档的好处

时间:2022-10-27 06:59:37

对于一些新的技术文档,相关的中文版文档相对很少,而且很多的翻译并不是很准确,也不确定是否会漏掉一些关键的信息。

即便是相对成熟的框架,比如angular框架,你在搜索某些问题的时候,如果能直接看官方文档,你可能一下就明白了(前提是你有比较好的英文阅读能力)。

而百度或者google出来的中文解释则可能是经过别人的理解之后的一个答案,他的理解不一定能让你明白。

比如,angular和config和run的区别?

中文的解释:

config阶段是给了ng上下文一个针对constant与provider修改其内部属性的一个阶段
而run阶段是在config之后的在运行独立的代码块,通常写法runBlock
简单的说一下就是ng启动阶段是 config-->run-->compile/link

完了之后你可能还是很懵比,还得继续找你能明白的解释。

官方解释:

Configuration blocks - get executed during the provider registrations and configuration phase. Only providers and constants can be injected into configuration blocks. This is to prevent accidental instantiation of services before they have been fully configured.

Run blocks - get executed after the injector is created and are used to kickstart the application. Only instances and constants can be injected into run blocks. This is to prevent further system configuration during application run time.

官方文档相对来说好理解一些对不对?一目了然。