Angular2 How to get APP_BASE_HREF programatically?

How to get APP_BASE_HREF programatically? I have this in my app.module.ts (where APP_BASE='/'): { provide: APP_BASE_HREF, useValue: '<%= APP_BASE %>' }, I'm trying: import {