How can I check which version of Angular I'm using?

前端 未结 28 974
死守一世寂寞
死守一世寂寞 2020-11-28 18:23

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

I have tried:

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

but get

相关标签:
28条回答
  • 2020-11-28 18:43

    There are many way, you check angular version Just pent the comand prompt(for windows) and type

    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
    

    Full understanding of subversion about(x.x.x) please see angular documentation angularJS and angular 2+

    0 讨论(0)
  • 2020-11-28 18:43

    you can just type ng version thats it

    0 讨论(0)
  • 2020-11-28 18:44

    You could also check your package.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.)

    0 讨论(0)
  • 2020-11-28 18:45

    You can also check it by inspecting the elements on the page:

    1. press F12 to open Browser's developer tools.

    2. Inspect an Element.

    3. Expand Body

    4. You will see the version of Angular, like the following:

    ng-version="4.3.6"

    0 讨论(0)
  • 2020-11-28 18:46

    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.

    0 讨论(0)
  • 2020-11-28 18:47

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

    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.

    Object {full: "1.4.3", major: 1, minor: 4, dot: 3, codeName: "foam-acceleration"}
    
    0 讨论(0)
提交回复
热议问题