gpt4 book ai didi

angular - Angular 2+ 源代码中的 ɵ(类 Theta)符号

转载 作者:太空狗 更新时间:2023-10-29 16:55:16 24 4
gpt4 key购买 nike

在深入研究 Angular 4.3.* 源代码后,我经常碰到 ɵ 符号。例如,在 async pipe source 中我们看到了 ɵisPromise(_)ɵisObservable(_) 函数的用法。所以现在我想知道为什么 Angular 团队决定使用它?这是什么意思?

似乎 Angular 开发人员用 ɵ 标记方法/模块以强调它们是某种永远不应该导入的内部实体。但是我没有找到任何权威的证据。

经过更深入的研究,我发现了另一个有趣的事实:基本上 ɵ 是几个拉丁字母表中的一个字母(根据维基,它被包含在 1922 年至 1933 年间使用的阿塞拜疆字母表中)但它类似于希腊字母 θ (Theta)。经过一番谷歌搜索后,我设法找到了 Angular 速度计算的数学公式(毕业后成功忘记),其中 Theta 字母表示 Angular 。所以也许这是一种幽默?

最佳答案

So now I wonder why Angular team decided to use it? And what does it mean?

是的,它将方法标记为内部/私有(private)。这是来自 the article 的引述那是 Uri Shaked 写的谁从 Angular 核心团队成员那里得到了这些信息:

The first thing you many notice is a lot of obscure method names, starting with the letter ɵ (Greek Theta) followed by 3 other English letters (e.g. ɵvid). The letter ɵ is used by the Angular team to indicate that some method is private to the framework and must not be called directly by the user, as the API for these method is not guaranteed to stay stable between Angular versions (in fact, I would say it’s almost guaranteed to break).

关于angular - Angular 2+ 源代码中的 ɵ(类 Theta)符号,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45466017/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com