<p dir="auto">How can you get the version of angular2 at runtime?<br>
will help for debugging and stack capture, is it possible to get ng2 ver in runtime?</p>
<p dir="auto">regards</p>
<p dir="auto">Sean</p>
<p dir="auto">Hi.</p>
<p dir="auto">In AngularJS 1.x, <code class="notranslate">console.log(angular.version);</code> to output the following.</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="{
  full: &quot;1.3.x&quot;,
  major: 1,
  minor: 3,
  dot: x,
  codeName: &quot;codeName&quot;
}"><pre class="notranslate"><code class="notranslate">{
  full: "1.3.x",
  major: 1,
  minor: 3,
  dot: x,
  codeName: "codeName"
}
</code></pre></div>
<p dir="auto">I want you to adopt also in Angular 2 this feature for utility development. For example,</p>
<div class="highlight highlight-source-js notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="import * as angular2 from 'angular2/angular2';
console.log(angular2.version);"><pre class="notranslate"><span class="pl-k">import</span> <span class="pl-c1">*</span> <span class="pl-k">as</span> <span class="pl-s1">angular2</span> <span class="pl-k">from</span> <span class="pl-s">'angular2/angular2'</span><span class="pl-kos">;</span>
<span class="pl-smi">console</span><span class="pl-kos">.</span><span class="pl-en">log</span><span class="pl-kos">(</span><span class="pl-s1">angular2</span><span class="pl-kos">.</span><span class="pl-c1">version</span><span class="pl-kos">)</span><span class="pl-kos">;</span></pre></div>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="{
  full: &quot;2.0.0-alpha.n&quot;,
  major: 2,
  minor: 0,
  dot: 0,
  codeName: &quot;codeName&quot;
}"><pre class="notranslate"><code class="notranslate">{
  full: "2.0.0-alpha.n",
  major: 2,
  minor: 0,
  dot: 0,
  codeName: "codeName"
}
</code></pre></div>
<p dir="auto">Thanks.</p>