ɵ (Theta-like) symbol in Angular 2+ source code

纵饮孤独 提交于 2019-12-04 15:37:20

问题


After a deep dive into an Angular 4.3.* source code I was bumping into ɵ symbol quite often. For example, in async pipe source we see the usage of ɵisPromise(_) and ɵisObservable(_) functions. So now I wonder why Angular team decided to use it? And what does it mean?

It seems that Angular devs mark methods/modules with ɵ to emphasize they are some kind of inner entities that should never be imported. But I didn`t find any authoritative proofs.

After some deeper research I found another interesting fact: basically ɵ is a letter in several Latin-script alphabets (according to wiki was included into the Azerbaijani alphabet used between 1922 and 1933) but it resembles Greek θ (Theta) letter. After some googling I managed to find a Math formula (successfully forgotten after graduation) of angular velocity calculation, where Theta letter meant angle. So maybe this is a kind of humour?


回答1:


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

Yes, it marks methods as internal/private. Here is the quote from the article that was written by Uri Shaked who got this information from the Angular core team members:

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).



来源:https://stackoverflow.com/questions/45466017/%c9%b5-theta-like-symbol-in-angular-2-source-code

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!