I have written a simple app with angular2@2.0.0-alpha.11, and it works great. Now that I am testing it with the latest version of the alpha and beta avaible on npm, and I ke
New answer since accepted one no longer the case on stable angular releases, easiest way to check angular version is to do so with npm list command at project root:
npm list @angular/core
Just in case you can check following as well, versions should match:
npm list @angular/common
npm list @angular/compiler
Update since 4.0.0-rc.1
Version is added for root selector in the DOM
Since angular2 version 2.3.0-rc.0 you can get version as follows:
import { VERSION } from '@angular/core';
export class AppComponent {
constructor() {
console.log(VERSION.full); // print 2.3.0-rc.0
}
}
Or you can just open browser console and check body
tag
The fact that current angular 2 is beta 13 combined with a simple search : https://github.com/angular/angular/search?l=typescript&p=1&q=13&type=Code&utf8=%E2%9C%93 and a look through docs https://angular.io/docs/ts/latest/api/ means that its not exposed at runtime as a simple version number
Feel free to request it as a feature here : https://github.com/angular/angular/issues
ng -v
shows version of cli, node, os & angular.