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

我试过:

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

但是没有找到get -bash: angular:命令

通过yeoman -version我知道我使用的是0.9.6

但是如何获得angularjs版本呢?


当前回答

有很多方法,你检查角版本只是压抑的命令 提示(用于windows)并键入

1. ng version
2. ng v
3. ng -v

4. You can pakage.json file

5.You can check in browser by presing F12 then goto elements tab

关于subversion (x.x.x)的完整理解,请参阅angular文档angularJS和angular 2+

其他回答

如果你正在使用angular-cli,只需使用命令:

ng v

如果你使用的是VS Code编辑器。

转到资源管理器面板左侧->找到包。在依赖项下找到@angular/core。

这是你的角版本作为核心是主要的特点

1. ng --version (For checking Installed Angular Version in system)

2. npm --version (For checking Installed NPM Version in system) 

3. node --version (For checking Installed Node Version in system) 

现在是ng -v

如果你正在使用angular cli,那么你可以检查using

的 --版本

现在是ng -v

或者你也可以签到

行囊。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"
  },

另一种方法是从@angular/core导入VERSION常量,然后转储到控制台:

console.log(VERSION.full); //5.2.11

适用于:

Angular 8参见docs Angular 7参见docs Angular 6参见文档。 Angular 5参见docs Angular 4参见docs

Angular 2和3不太确定。(如果有人能测试一下;网页不可用)


对于AngularJS 1。使用angular.version:

console.log(angular.version); //1.7.4