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

我试过:

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

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

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

但是如何获得angularjs版本呢?


当前回答

这很简单, 你可以在包装上看到。json文件

其他回答

对于Angular 2+

检查元素(Ctrl + Shift + I) goTo元素部分,滚动到<app-root>标签(参考下图)

你可以从终端使用angular 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$ 

有很多方法,你检查角版本只是压抑的命令 提示(用于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+

对于AngularJS -使用angular.version

console.log (angular.version); < script src = " / / unpkg.com/angular/angular.js " > < /脚本>

有关更多信息,请参见

盎格鲁-盎格鲁

只需在命令中输入ng v即可

你会得到这样的结果

Angular CLI: 7.3.9
Node: 12.11.0
OS: win32 x64
Angular: 7.2.15
... common, compiler, compiler-cli, core, f
... language-service, platform-browser, pla
... router

Package                           Version
-------------------------------------------
@angular-devkit/architect         0.13.9
@angular-devkit/build-angular     0.13.9
@angular-devkit/build-optimizer   0.13.9
@angular-devkit/build-webpack     0.13.9
@angular-devkit/core              7.3.9
@angular-devkit/schematics        7.3.9
@angular/cli                      7.3.9
@ngtools/webpack                  7.3.9
@schematics/angular               8.0.0
@schematics/update                0.13.9
rxjs                              6.5.3
typescript                        3.1.6
webpack                           4.29.0