import { Inject , Injectable } from '@angular/core' ; import { RESPONSE } from '@nguniversal/express-engine/tokens' ; export class HeadersService { public setCode ( code ) { } } @ Injectable ( ) export class BrowserHeadersService extends HeadersService { setCode ( code ) { } } @ Injectable ( ) export class ServerHeadersService extends HeadersService { constructor ( @ Inject ( RESPONSE ) private res ) { super ( ) ; } setCode ( code ) { this . res . status ( code ) ; } }