我如何检查我使用的是哪个版本的角度?

时间:2022-01-20 20:14:41

How can I tell which version of Angular I am using?

我如何知道我使用的是哪个版本的角度?

I have tried:

我有尝试:

angular --version
angular --v
angular -version
angular -v

but get -bash: angular: command not found

但get -bash:角度:命令未找到。

I know by yeoman --version that I am using 0.9.6

据我所知,我使用的版本是0.9.6。

But how do get the angularjs version?

但是如何获得angularjs版本呢?

13 个解决方案

#1


158  

Angular does not have a command line tool.

角度没有命令行工具。

You can write command on CMD "ng -v" it will show whole detail of angular cli

您可以在CMD“ng -v”上写命令,它将显示角cli的全部细节。

You can get the version number from the JavaScript file itself.

您可以从JavaScript文件本身获取版本号。

Header of the current angular.js:

当前angular.js的标题:

/**
 * @license AngularJS v1.0.6
 * (c) 2010-2012 Google, Inc. http://angularjs.org
 * License: MIT
 */

Edit: When this answer was written, there was only Angular 1.x. Look in the answers below for Angular versions >= 2.

编辑:当这个答案写出来的时候,只有角1。x。在下面的答案中,我们可以看到角化的>= 2。

#2


247  

You can also open the console on the developer tools of whatever browser you use and type angular.version to access the Javascript object that holds angular version.

您还可以在您使用的任何浏览器的开发工具上打开控制台,并键入角度。用于访问持有角版本的Javascript对象的版本。

Very useful when the script is minified with no header comment.

在没有标题注释的情况下,非常有用。

#3


74  

Use IE 11 and IE Edge browser's developer tools, you can find information here.我如何检查我使用的是哪个版本的角度?

使用IE 11和IE Edge浏览器的开发工具,您可以在这里找到信息。

Chrome browser

Chrome浏览器

我如何检查我使用的是哪个版本的角度?

Firefox firebug

Firefox的firebug

我如何检查我使用的是哪个版本的角度?

#4


70  

In the browser's developer console (press F12 to open it), you can type the following,

在浏览器的developer console(按F12打开它),您可以输入以下内容,

angular.version.full

it will give you the full version, e.g. (depending on your current version). [It actually gets the full property of angular.version object.]

它会给你完整的版本,例如(取决于你现在的版本)。它实际上得到了角的全部性质。版本对象。)

"1.4.3"

So, to see the full object, if you type

所以,要看到完整的对象,如果你输入。

angular.version

It will give you the full version object containing version information like full, major, minor and also the codeName, e.g.

它将提供完整版本的对象,包含完整的、主要的、小的和codeName的版本信息。

Object {full: "1.4.3", major: 1, minor: 4, dot: 3, codeName: "foam-acceleration"}

#5


46  

If you are using angular-cli, then you can check it easily by typing

如果您使用的是angular-cli,那么您可以通过键入来轻松地检查它。

ng -v

in Terminal or Bash. Note: Run the command within the project directory.

在终端或Bash。注意:在项目目录中运行该命令。

You should get something like this:

你应该得到这样的东西:

angular-cli: 1.0.0-beta.24
node: 7.4.0
os: darwin x64
@angular/common: 2.4.3
@angular/compiler: 2.4.3
@angular/core: 2.4.3
@angular/forms: 2.4.3
@angular/http: 2.4.3
@angular/platform-browser: 2.4.3
@angular/platform-browser-dynamic: 2.4.3
@angular/router: 3.4.3
@angular/compiler-cli: 2.4.3

#6


21  

You could also check your package.json:

您还可以检查您的包。json:

"dependencies": {
    "@angular/common": "^5.0.0",
    "@angular/compiler": "^5.0.0",
    "@angular/core": "^5.0.0",
    "@angular/forms": "^5.0.0",
    "@angular/http": "^5.0.0",
    "@angular/platform-browser": "^5.0.0",
    "@angular/platform-browser-dynamic": "^5.0.0",
    "@angular/router": "^5.0.0",
  }

(The caret ^ will update you to the most recent major version (the first number). ^4.3.0 will match any 4.x.x release including 4.4.0, but will hold off on 5.0.0. The tilde ~ matches the most recent minor version (the middle number). ~4.3.0 will match all 4.3.x versions, but will miss 4.4.0.)

(插入符号^将更新您最新的主要版本(第一个数字)。安装^ 4.3.0将匹配任何4. x。x版本包括4.4.0,但将保持在5.0.0。波浪号与最近的小版本(中间号)匹配。~4.3.0将匹配所有4.3。x版本,但将会错过4.4.0。

#7


8  

If you are useing angular cli then you can check useing

如果你使用角cli,那么你可以检查使用。

ng --version

ng——版本

Or you can also check in

或者你也可以登记入住。

pakage.json file

行囊。json文件

 "dependencies": {
    "@angular/animations": "^4.0.0",
    "@angular/common": "^4.0.0",
    "@angular/compiler": "^4.0.0",
    "@angular/core": "^4.0.0",
    "@angular/forms": "^4.0.0",
    "@angular/http": "^4.0.0",
    "@angular/platform-browser": "^4.0.0",
    "@angular/platform-browser-dynamic": "^4.0.0",
    "@angular/router": "^4.0.0",
    "angular-in-memory-web-api": "^0.3.2",
    "core-js": "^2.4.1",
    "rxjs": "^5.1.0",
    "zone.js": "^0.8.4"
  },

#8


7  

To Angular 4, many of the options no longer work. Update July 2017 Two posibilities:

对于角4,许多选项不再起作用。2017年7月更新:

1) The simplest one is to open the package.json of our project and to check the versions used, among them the one of Angular.

最简单的就是打开包装。我们的项目的json,并检查所用的版本,其中一个角。

我如何检查我使用的是哪个版本的角度?

2) After executing ng serve, we open the inspector of elements of the explorer that we use and we can observe the version as in the following image.

2)在执行ng服务后,打开我们使用的explorer元素的检查器,我们可以看到如下图所示的版本。

我如何检查我使用的是哪个版本的角度?

#9


2  

If you are using angular-cli, simply use command:

如果您使用的是angular-cli,只需使用命令:

ng v

#10


1  

On your project folder, open the command terminal and type

在您的项目文件夹中,打开命令终端并键入。

ng -v

it will give you a list of items, in that you will be able to see the angular version. See the screenshot.

它会给你一个项目列表,你可以看到它的角度。见截图。

我如何检查我使用的是哪个版本的角度?

#11


1  

version after angular 2 you can use from terminal,

角2后的版本你可以使用终端,

ng -v



    _                      _                 ____ _     ___
   / \   _ __   __ _ _   _| | __ _ _ __     / ___| |   |_ _|
  / △ \ | '_ \ / _` | | | | |/ _` | '__|   | |   | |    | |
 / ___ \| | | | (_| | |_| | | (_| | |      | |___| |___ | |
/_/   \_\_| |_|\__, |\__,_|_|\__,_|_|       \____|_____|___|
               |___/

Angular CLI: 1.7.3
Node: 9.3.0
OS: linux x64
Angular: 5.2.9
... animations, common, compiler, compiler-cli, core, forms
... http, language-service, platform-browser
... platform-browser-dynamic, router

@angular/cli: 1.7.3
@angular-devkit/build-optimizer: 0.3.2
@angular-devkit/core: 0.3.2
@angular-devkit/schematics: 0.3.2
@ngtools/json-schema: 1.2.0
@ngtools/webpack: 1.10.2
@schematics/angular: 0.3.2
@schematics/package-update: 0.3.2
typescript: 2.5.3
webpack: 3.11.0
mohideen@root:~/apps/UI$ 

#12


1  

Both commands work:

这两个命令工作:

ng -v

or

ng v

我如何检查我使用的是哪个版本的角度?

#13


0  

It will be Here..

它将在这里. .

../project_name/bower_components/angular/angular.js

. . / project_name bower_components /角度/ angular.js

/**
 * @license AngularJS v1.0.6
 * (c) 2010-2012 Google, Inc. http://angularjs.org
 * License: MIT
 */

#1


158  

Angular does not have a command line tool.

角度没有命令行工具。

You can write command on CMD "ng -v" it will show whole detail of angular cli

您可以在CMD“ng -v”上写命令,它将显示角cli的全部细节。

You can get the version number from the JavaScript file itself.

您可以从JavaScript文件本身获取版本号。

Header of the current angular.js:

当前angular.js的标题:

/**
 * @license AngularJS v1.0.6
 * (c) 2010-2012 Google, Inc. http://angularjs.org
 * License: MIT
 */

Edit: When this answer was written, there was only Angular 1.x. Look in the answers below for Angular versions >= 2.

编辑:当这个答案写出来的时候,只有角1。x。在下面的答案中,我们可以看到角化的>= 2。

#2


247  

You can also open the console on the developer tools of whatever browser you use and type angular.version to access the Javascript object that holds angular version.

您还可以在您使用的任何浏览器的开发工具上打开控制台,并键入角度。用于访问持有角版本的Javascript对象的版本。

Very useful when the script is minified with no header comment.

在没有标题注释的情况下,非常有用。

#3


74  

Use IE 11 and IE Edge browser's developer tools, you can find information here.我如何检查我使用的是哪个版本的角度?

使用IE 11和IE Edge浏览器的开发工具,您可以在这里找到信息。

Chrome browser

Chrome浏览器

我如何检查我使用的是哪个版本的角度?

Firefox firebug

Firefox的firebug

我如何检查我使用的是哪个版本的角度?

#4


70  

In the browser's developer console (press F12 to open it), you can type the following,

在浏览器的developer console(按F12打开它),您可以输入以下内容,

angular.version.full

it will give you the full version, e.g. (depending on your current version). [It actually gets the full property of angular.version object.]

它会给你完整的版本,例如(取决于你现在的版本)。它实际上得到了角的全部性质。版本对象。)

"1.4.3"

So, to see the full object, if you type

所以,要看到完整的对象,如果你输入。

angular.version

It will give you the full version object containing version information like full, major, minor and also the codeName, e.g.

它将提供完整版本的对象,包含完整的、主要的、小的和codeName的版本信息。

Object {full: "1.4.3", major: 1, minor: 4, dot: 3, codeName: "foam-acceleration"}

#5


46  

If you are using angular-cli, then you can check it easily by typing

如果您使用的是angular-cli,那么您可以通过键入来轻松地检查它。

ng -v

in Terminal or Bash. Note: Run the command within the project directory.

在终端或Bash。注意:在项目目录中运行该命令。

You should get something like this:

你应该得到这样的东西:

angular-cli: 1.0.0-beta.24
node: 7.4.0
os: darwin x64
@angular/common: 2.4.3
@angular/compiler: 2.4.3
@angular/core: 2.4.3
@angular/forms: 2.4.3
@angular/http: 2.4.3
@angular/platform-browser: 2.4.3
@angular/platform-browser-dynamic: 2.4.3
@angular/router: 3.4.3
@angular/compiler-cli: 2.4.3

#6


21  

You could also check your package.json:

您还可以检查您的包。json:

"dependencies": {
    "@angular/common": "^5.0.0",
    "@angular/compiler": "^5.0.0",
    "@angular/core": "^5.0.0",
    "@angular/forms": "^5.0.0",
    "@angular/http": "^5.0.0",
    "@angular/platform-browser": "^5.0.0",
    "@angular/platform-browser-dynamic": "^5.0.0",
    "@angular/router": "^5.0.0",
  }

(The caret ^ will update you to the most recent major version (the first number). ^4.3.0 will match any 4.x.x release including 4.4.0, but will hold off on 5.0.0. The tilde ~ matches the most recent minor version (the middle number). ~4.3.0 will match all 4.3.x versions, but will miss 4.4.0.)

(插入符号^将更新您最新的主要版本(第一个数字)。安装^ 4.3.0将匹配任何4. x。x版本包括4.4.0,但将保持在5.0.0。波浪号与最近的小版本(中间号)匹配。~4.3.0将匹配所有4.3。x版本,但将会错过4.4.0。

#7


8  

If you are useing angular cli then you can check useing

如果你使用角cli,那么你可以检查使用。

ng --version

ng——版本

Or you can also check in

或者你也可以登记入住。

pakage.json file

行囊。json文件

 "dependencies": {
    "@angular/animations": "^4.0.0",
    "@angular/common": "^4.0.0",
    "@angular/compiler": "^4.0.0",
    "@angular/core": "^4.0.0",
    "@angular/forms": "^4.0.0",
    "@angular/http": "^4.0.0",
    "@angular/platform-browser": "^4.0.0",
    "@angular/platform-browser-dynamic": "^4.0.0",
    "@angular/router": "^4.0.0",
    "angular-in-memory-web-api": "^0.3.2",
    "core-js": "^2.4.1",
    "rxjs": "^5.1.0",
    "zone.js": "^0.8.4"
  },

#8


7  

To Angular 4, many of the options no longer work. Update July 2017 Two posibilities:

对于角4,许多选项不再起作用。2017年7月更新:

1) The simplest one is to open the package.json of our project and to check the versions used, among them the one of Angular.

最简单的就是打开包装。我们的项目的json,并检查所用的版本,其中一个角。

我如何检查我使用的是哪个版本的角度?

2) After executing ng serve, we open the inspector of elements of the explorer that we use and we can observe the version as in the following image.

2)在执行ng服务后,打开我们使用的explorer元素的检查器,我们可以看到如下图所示的版本。

我如何检查我使用的是哪个版本的角度?

#9


2  

If you are using angular-cli, simply use command:

如果您使用的是angular-cli,只需使用命令:

ng v

#10


1  

On your project folder, open the command terminal and type

在您的项目文件夹中,打开命令终端并键入。

ng -v

it will give you a list of items, in that you will be able to see the angular version. See the screenshot.

它会给你一个项目列表,你可以看到它的角度。见截图。

我如何检查我使用的是哪个版本的角度?

#11


1  

version after angular 2 you can use from terminal,

角2后的版本你可以使用终端,

ng -v



    _                      _                 ____ _     ___
   / \   _ __   __ _ _   _| | __ _ _ __     / ___| |   |_ _|
  / △ \ | '_ \ / _` | | | | |/ _` | '__|   | |   | |    | |
 / ___ \| | | | (_| | |_| | | (_| | |      | |___| |___ | |
/_/   \_\_| |_|\__, |\__,_|_|\__,_|_|       \____|_____|___|
               |___/

Angular CLI: 1.7.3
Node: 9.3.0
OS: linux x64
Angular: 5.2.9
... animations, common, compiler, compiler-cli, core, forms
... http, language-service, platform-browser
... platform-browser-dynamic, router

@angular/cli: 1.7.3
@angular-devkit/build-optimizer: 0.3.2
@angular-devkit/core: 0.3.2
@angular-devkit/schematics: 0.3.2
@ngtools/json-schema: 1.2.0
@ngtools/webpack: 1.10.2
@schematics/angular: 0.3.2
@schematics/package-update: 0.3.2
typescript: 2.5.3
webpack: 3.11.0
mohideen@root:~/apps/UI$ 

#12


1  

Both commands work:

这两个命令工作:

ng -v

or

ng v

我如何检查我使用的是哪个版本的角度?

#13


0  

It will be Here..

它将在这里. .

../project_name/bower_components/angular/angular.js

. . / project_name bower_components /角度/ angular.js

/**
 * @license AngularJS v1.0.6
 * (c) 2010-2012 Google, Inc. http://angularjs.org
 * License: MIT
 */