ng在角度上代表什么?js指令

时间:2021-05-05 12:09:25

Angular.js uses several directives prefixed with ng like below:

角。js使用了一些前缀为ng的指令:

ng (base directive)

ng(基本指令)

ng-switch
ng-repeat
ng-view

I was wondering if anyone knew what ng stood for because I couldn't find it in the docs. Is it an acronym for something?

我想知道是否有人知道ng的意思,因为我在文档中找不到。它是某物的首字母缩写吗?

6 个解决方案

#1


227  

The prefix ng stands for "Angular;" all of the built-in directives that ship with Angular use that prefix. Similarly, it is recommended that you do not use the ng prefix on your own directives in order to avoid possible name collisions in future versions of Angular.

前缀ng代表“角度”,所有的内置指令都用角来表示。同样,建议您不要在自己的指令上使用ng前缀,以免在将来的角度版本中避免名称冲突。

From the FAQ:

常见问题解答:

Why is this project called "AngularJS"? Why is the namespace called "ng"?

为什么这个项目被称为“AngularJS”?为什么命名空间称为“ng”?

Because HTML has Angular brackets and "ng" sounds like "Angular".

因为HTML有尖括号,“ng”听起来像“角”。

#2


36  

I guess there are not many Star Trek fans among you. "ng" stands for Next Generation, as Angular is the next generation of HTML.

我想你们中间没有多少星际迷航迷。“ng”代表下一代,因为角度是下一代的HTML。

"Enhanced" HTML I would say xD.

“增强的”HTML我想说xD。

#3


21  

I thought they took an arbitrary subsection of the Angular name and used it as the name space:

我想他们取了一个任意的角名,并把它用作名字空间:

aNGular

Plus "NG" does not sound like Angular; no matter which way you say it.

加上“NG”听起来不像角;不管你怎么说。

#4


7  

NG stands for "Next Generation".

NG代表“下一代”。

It is used in many applications as a suffix, specially in Linux. Example: syslog-ng and Aircrack-ng.

它在许多应用程序中用作后缀,特别是在Linux中。例如:syslog-ng Aircrack-ng。

#5


5  

ng is an abbreviation of Angular.

ng是角的缩写。

Programmers don't like to code long names, so they keep it short and that makes it a bit more cryptic. If you look at Assembler, you know what I mean with ADD, JMP etc. JQuery is the name, the $ is what you use. Angular is the name, ng is what you use.

程序员不喜欢编码长的名字,所以他们保持简短,这使它变得更神秘。如果你看汇编程序,你知道我的意思是添加,JMP等。JQuery是你的名字,你用的是$。角是名字,ng是你用的。

#6


4  

According to the AngularJS Miscellaneous FAQ:

根据AngularJS繁杂的常见问题:

Why is this project called "AngularJS"? Why is the namespace called "ng"?
Because HTML has Angular brackets and "ng" sounds like "Angular".

为什么这个项目被称为“AngularJS”?为什么命名空间称为“ng”?因为HTML有尖括号,“ng”听起来像“角”。

#1


227  

The prefix ng stands for "Angular;" all of the built-in directives that ship with Angular use that prefix. Similarly, it is recommended that you do not use the ng prefix on your own directives in order to avoid possible name collisions in future versions of Angular.

前缀ng代表“角度”,所有的内置指令都用角来表示。同样,建议您不要在自己的指令上使用ng前缀,以免在将来的角度版本中避免名称冲突。

From the FAQ:

常见问题解答:

Why is this project called "AngularJS"? Why is the namespace called "ng"?

为什么这个项目被称为“AngularJS”?为什么命名空间称为“ng”?

Because HTML has Angular brackets and "ng" sounds like "Angular".

因为HTML有尖括号,“ng”听起来像“角”。

#2


36  

I guess there are not many Star Trek fans among you. "ng" stands for Next Generation, as Angular is the next generation of HTML.

我想你们中间没有多少星际迷航迷。“ng”代表下一代,因为角度是下一代的HTML。

"Enhanced" HTML I would say xD.

“增强的”HTML我想说xD。

#3


21  

I thought they took an arbitrary subsection of the Angular name and used it as the name space:

我想他们取了一个任意的角名,并把它用作名字空间:

aNGular

Plus "NG" does not sound like Angular; no matter which way you say it.

加上“NG”听起来不像角;不管你怎么说。

#4


7  

NG stands for "Next Generation".

NG代表“下一代”。

It is used in many applications as a suffix, specially in Linux. Example: syslog-ng and Aircrack-ng.

它在许多应用程序中用作后缀,特别是在Linux中。例如:syslog-ng Aircrack-ng。

#5


5  

ng is an abbreviation of Angular.

ng是角的缩写。

Programmers don't like to code long names, so they keep it short and that makes it a bit more cryptic. If you look at Assembler, you know what I mean with ADD, JMP etc. JQuery is the name, the $ is what you use. Angular is the name, ng is what you use.

程序员不喜欢编码长的名字,所以他们保持简短,这使它变得更神秘。如果你看汇编程序,你知道我的意思是添加,JMP等。JQuery是你的名字,你用的是$。角是名字,ng是你用的。

#6


4  

According to the AngularJS Miscellaneous FAQ:

根据AngularJS繁杂的常见问题:

Why is this project called "AngularJS"? Why is the namespace called "ng"?
Because HTML has Angular brackets and "ng" sounds like "Angular".

为什么这个项目被称为“AngularJS”?为什么命名空间称为“ng”?因为HTML有尖括号,“ng”听起来像“角”。