Wondering how to find the Angular version used in your application? There are several different ways to do this, depending on whether you prefer command-line tools, file inspection or a code-based approach.
Knowing the Angular version of your project will help you to manage its lifecycle effectively – from development and testing to deployment and maintenance. It will also maintain compatibility, security, and optimal performance of your application.
So here are a few popular options you can choose from:
Checking package.json
Another way to check the Angular version is to check the package.json file in your project directory to see the Angular packages version. Simply look for the dependencies section in the package.json file.
The version number next to @angular/core will indicate the Angular version used in your application.
Using the browser’s developer toolbar
Open your Angular application in a browser, go to the “Elements” tab and search for ‘ng-version’.
Checking the application code
An alternative way to check the Angular version is to check the version programmatically by accessing it from the Angular core package. Simply import the version package in your code and use it to get the current version used in your application.