import { ApplicationConfig } from '../../../common/entities/ApplicationConfig'; export function CorgiSectionDirectiveFactory() { return new CorgiSectionDirective(); } export class CorgiSectionDirective implements ng.IDirective { restrict = 'E'; bindToController = true; controller = CorgiSectionController; controllerAs = 'ctrl'; template = require('./corgiSection.html'); scope = { customerId: '=' } } export class CorgiSectionController { customerId: string; infoLink: string = 'http://www.corgihomeplan.co.uk/OVO?utm_source=ovo&utm_medium=acquisition&utm_campaign=ovo-offer1'; asset: any; promoActive: boolean = true; constructor(assets: any, APP_CONFIG: ApplicationConfig) { this.asset = assets.getAssetUrl; this.promoActive = APP_CONFIG.FLAGS.CORGI_PROMO_ACTIVE; if (this.customerId) { this.infoLink += '&customerId=' + this.customerId; } } }