How to check which version of Angular from browser?

I am trying to buy an angular 5 template online, so I just want to confirm the version of angular. I have a check. This question is angular: -

How to check which version of angular I'm using?

But here in this question, the version of the application is shown below in the image, which is taken from the development tool,

ng-version is in app tag. 

enter image description here

But in the template that I am trying to acquire, there is the following structure.

 ng-version is in body tag. 

enter image description here

So, just for confirmation, I just installed angular 5. Here, in the newly installed application, they show

ng-version is in app-root.

enter image description here

There are other files in this template, such as

 <script type="text/javascript" src="inline.bundle.js"></script> <script type="text/javascript" src="polyfills.bundle.js"></script> <script type="text/javascript" src="styles.bundle.js"></script> <script type="text/javascript" src="vendor.bundle.js"></script> <script type="text/javascript" src="main.bundle.js"> 

I also tried with angular.version , but this does not work for me.

So, it’s confirmed that they use the angular App is not another, but I am confused by this Angular -2.4 or 5.

Is there any other way we can figure out which version works?

+5
source share
2 answers

Due to Kyler Help, I realized that this template is not built with Angular -5. It is lower than version of Angular 2 beta.8 (I do not know the exact version, but not Angular -5).

They show that they are made with Angular -5, but that is not because it shows me an error.

 Uncaught ReferenceError: getAllAngularRootElements is not defined 

Because with reference to this git problem: - https://github.com/rangle/augury/issues/245

I understand that getAllAngularRootElements() will work with Angular2 beta.8 and higher. Thus, this means that it is lower than the beta version of Angular 2.

And I tried this function with my Angular -5 application, and this function works.

enter image description here

+1
source

Using the ng-version attribute is the right way to identify the version number of Angular. if you want more confirmation, you can do in the console:

 getAllAngularRootElements(); 

which will show you the elements of Angular. Or more precisely

  getAllAngularRootElements()[0].attributes["ng-version"]; 
+1
source

Source: https://habr.com/ru/post/1275400/


All Articles