Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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?

like image 530
Mike Kovetsky Avatar asked Aug 02 '17 16:08

Mike Kovetsky


1 Answers

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

like image 109
Max Koretskyi Avatar answered Oct 19 '22 09:10

Max Koretskyi