import { LayoutState } from "../common/state/LayoutState"; import { UserDataState } from "../common/state/UserDataState"; import { ApplicationConfig } from "../common/entities/ApplicationConfig"; import { AppConfigType } from "../common/entities/AppConfig"; export class BoostIntroController { asset: any; constructor(private $window: ng.IWindowService, private $stateParams: ng.ui.IStateParamsService, private $location: ng.ILocationService, assets: any, private layoutState: LayoutState, private userDataState: UserDataState, private APP_CONFIG: ApplicationConfig, private AppConfig: AppConfigType) { this.asset = assets.getAssetUrl; layoutState.title = 'Boost'; layoutState.back = () => $window.history.back(); } goBack(): void { this.$location.path('/get-quote').search(this.$stateParams["quoteParams"]); } goToBoost(): void { const boostLink = (this.AppConfig.csa)? this.APP_CONFIG.BOOST_CSA_URL + '/get-quote?postcode=' + this.userDataState.postcode + '&fuel=' + this.userDataState.fuel : this.APP_CONFIG.BOOST_URL + '/get-quote?postcode=' + this.userDataState.postcode + '&fuel=' + this.userDataState.fuel; this.$window.open(boostLink); return; } }