How can I check which version of Angular from browser?

Bhavin picture Bhavin · Feb 16, 2018 · Viewed 15.8k times · Source

I'm trying to buy a angular 5 template online so I just want to confirm for angular version. I have check This question of Angular :-

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

But here in this question app version is shown in below image which is captured from development tool,

ng-version is in app tag.

enter image description here

But in the template which I'm trying to purchase has following structure.

ng-version is in body tag.

enter image description here

So, Just for reconfirm I just installed Angular 5. Here in newly installed application they show,

ng-version is in app-root.

enter image description here

That template has other files like,

<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 have also Tried with angular.version but it doesn't work for me.

So, it is confirmed that they are using Angular App not other thing but I'm confused about it's Angular-2,4 or 5.

Is there any otherway we can figure it that which version it's running ?

Answer

Kyler Love picture Kyler Love · Feb 16, 2018

Using the ng-version attribute is the correct way to identify the Angular version number. if you want more confirmation you can execute in console:

getAllAngularRootElements();

which will show you Angular elements. Or more accurately

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