import { DynamicController } from './common/util/DynamicController'; import { GetQuoteController } from './get-quote/GetQuote'; import { GetQuoteControllerEV } from './get-quote/GetQuoteEV'; import { QuoteController } from './quote/Quote'; import { RefineQuoteController } from './refine-quote/RefineQuote'; import { PlanEVController } from './plan/paym/PlanEV'; import { PropertyQuestionsController } from './property-questions/PropertyQuestions'; import { PlanPaygController } from './plan/payg/PlanPayg'; import { SwitchController } from './switch/Switch'; import { SuccessEVController } from './success/paym/SuccessEV'; import { PlanPaymController } from './plan/paym/PlanPaym'; import { BoostIntroController } from './boost-intro/BoostIntroController'; import { SuccessPaymController } from './success/paym/SuccessPaym'; export function states($stateProvider: angular.ui.IStateProvider) { $stateProvider.state('main', { abstract: true, template: require("./layout/Layout.html"), controller: 'layoutController', controllerAs: 'ctrl' }); $stateProvider.state('main.boost-intro', { params: { forcedToView: false, quoteParams: {} }, url: '/boost-intro', template: require('./boost-intro/BoostIntro.html'), controller: BoostIntroController, controllerAs: 'ctrl' }); // Kill this off soon! $stateProvider.state('main.simply-smart', { params: { forcedToView: false, quoteParams: {} }, url: '/simply-smart', template: require('./simply-smart/SimplySmart.html'), controller: 'simplySmartController', controllerAs: 'ctrl' }); // Temporarily add /v2 into the urls so we can make these code changes slowly without breaking the functionality of the app // See https://github.com/angular-ui/ui-router/wiki/Nested-States-and-Nested-Views#abstract-states $stateProvider.state('main.v2', { abstract: true, url: '/v2', template: '' }); $stateProvider.state('main.v2.get-quote', { url: '/get-quote?postcode&paymentMethod&simplySmart', controller: GetQuoteController, template: require('./get-quote/GetQuote.html'), controllerAs: 'ctrl', }); $stateProvider.state('main.v2.quote', { url: '/quote', controller: QuoteController, template: require('./quote/Quote.html'), controllerAs: 'ctrl' }); $stateProvider.state('main.v2.refine-quote', { url: '/refine-quote', controller: RefineQuoteController, template: require('./refine-quote/RefineQuote.html'), controllerAs: 'ctrl' }); $stateProvider.state('main.v2.plan', { url: '/plan', controller: PlanPaymController, template: require('./plan/paym/PlanPaym.html'), controllerAs: 'ctrl' }); // Temporary - till we kill off PAYG $stateProvider.state('main.v2.plan-payg', { url: '/plan-payg', controller: PlanPaygController, template: require('./plan/payg/PlanPayg.html'), controllerAs: 'ctrl' }); // Temporary - till we kill off PAYG $stateProvider.state('main.v2.property-questions', { url: '/property-questions', controller: PropertyQuestionsController, template: require('./property-questions/PropertyQuestions.html'), controllerAs: 'ctrl' }); $stateProvider.state('main.v2.switch', { url: '/switch', views: { '': { template: require('./switch/Switch.html'), controller: SwitchController, controllerAs: 'ctrl' }, 'personalDetails@main.v2.switch': { template: require('./switch/SwitchPersonalDetails.html') }, 'bankDetails@main.v2.switch': { template: require('./switch/SwitchBankDetails.html') }, 'meterReading@main.v2.switch': { template: require('./switch/SwitchMeterReading.html') }, 'confirmation@main.v2.switch': { template: require('./switch/SwitchConfirmation.html') } } }); $stateProvider.state('main.v2.success', { url: '/success', template: require('./success/paym/SuccessPaym.html'), controller: SuccessPaymController, controllerAs: 'ctrl' }); // Start EV routes. // We add an abstract state to separate the EV routes. // See https://github.com/angular-ui/ui-router/wiki/Nested-States-and-Nested-Views#abstract-states $stateProvider.state('main.ev', { abstract: true, url: '/ev', template: '' }); $stateProvider.state('main.ev.get-quote', { url: '/get-quote?postcode', controller: GetQuoteControllerEV, template: require('./get-quote/GetQuoteEV.html'), controllerAs: 'ctrl' }); $stateProvider.state('main.ev.plan', { url: '/plan', controller: PlanEVController, template: require('./plan/paym/PlanEV.html'), controllerAs: 'ctrl' }); $stateProvider.state('main.ev.switch', { url: '/switch', views: { '': { template: require('./switch/Switch.html'), controller: SwitchController, controllerAs: 'ctrl' }, 'personalDetails@main.ev.switch': { template: require('./switch/SwitchPersonalDetails.html') }, 'bankDetails@main.ev.switch': { template: require('./switch/SwitchBankDetails.html') }, 'meterReading@main.ev.switch': { template: require('./switch/SwitchMeterReading.html') }, 'confirmation@main.ev.switch': { template: require('./switch/SwitchConfirmation.html') } } }); $stateProvider.state('main.ev.success', { url: '/success', template: require('./success/paym/SuccessEV.html'), controller: SuccessEVController, controllerAs: 'ctrl' }); // End EV routes. }