title: Angular2 How to get APP_BASE_HREF programmatically?
body: <p>How to get APP_BASE_HREF programmatically?</p>
  
  <p>I have this in my app.module.ts (where APP_BASE='/'):</p>
  
  <pre><code>{
      provide: APP_BASE_HREF,
      useValue: '&lt;%= APP_BASE %&gt;'
  },
  </code></pre>
  
  <p>I'm trying:</p>
  
  <pre><code>import { APP_BASE_HREF } from '@angular/common'; 
  ...
  console.debug(APP_BASE_HREF.toString());
  </code></pre>
  
  <p>and in console I get:</p>
  
  <pre><code>Token appBaseHref
  </code></pre>
  
  <p>and I need to get:</p>
  
  <pre><code>http://localhost:5555/
  </code></pre>