﻿var foraAsaApp = angular.module('foraAsaApp', ['ngSanitize', 'LocalStorageModule', 'ngRoute']);

foraAsaApp.config(function (localStorageServiceProvider) {
    localStorageServiceProvider.prefix = 'FORA';
});

foraAsaApp.config(['$qProvider', function ($qProvider) {
    $qProvider.errorOnUnhandledRejections(false);
}]);

foraAsaApp.config(function ($routeProvider, $locationProvider) {

    $routeProvider
        .when("/", {
            controller: 'CheckoutController',
            templateUrl: "/scripts/asa/checkout/index.html",
            reloadOnSearch: true
        })
        .when("/selectPayer", {
            controller: 'SelectPayerController',
            templateUrl: "/scripts/asa/checkout/selectPayer.html"
        })
        .when("/orderPreview", {
            controller: 'OrderPreviewController',
            templateUrl: "/scripts/asa/checkout/orderPreview.html"
        })
        .when("/payment", {
            controller: 'PaymentController',
            templateUrl: "/scripts/asa/checkout/payment.html"
        })
        .when("/thankyou", {
            controller: 'ThankYouController',
            templateUrl: "/scripts/asa/checkout/thankyou.html"
        })
        .when("/error", {
            controller: 'ErrorController',
            templateUrl: "/scripts/asa/checkout/error.html"
        })
        .when("/timeout", {
            controller: 'TimeoutController',
            templateUrl: "/scripts/asa/checkout/timeout.html"
        });;

    // TODO:
    //$locationProvider.html5Mode({
    //    enabled: true,
    //    requireBase: false
    //});
});