From f413ee9741d0306e0c014b5355df108307b36a2b Mon Sep 17 00:00:00 2001 From: baldo Date: Sat, 31 Aug 2019 20:23:40 +0200 Subject: [PATCH] Fix: Do not use hashbang URLs. * Links from firmware where broken. * Redirect hashbang URLs to normal ones for compatibility. --- app/scripts/app.js | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/app/scripts/app.js b/app/scripts/app.js index 3af244f..9d66d8d 100644 --- a/app/scripts/app.js +++ b/app/scripts/app.js @@ -8,8 +8,10 @@ angular.module('ffffng', [ 'templates-main', 'ui.bootstrap' ]) -.config(function ($logProvider, $routeProvider) { +.config(function ($logProvider, $locationProvider, $routeProvider) { $logProvider.debugEnabled(false); + $locationProvider.hashPrefix(''); + $locationProvider.html5Mode(false); $routeProvider .when('/', { templateUrl: 'views/main.html', @@ -42,7 +44,13 @@ angular.module('ffffng', [ title: 'Versand von Status-E-Mails deaktivieren' }) .otherwise({ - redirectTo: '/' + resolveRedirectTo: function ($location) { + var url = $location.url(); + if (url.startsWith('/!/')) { + return url.substring(3); + } + return '/'; + } }); }) .service('Navigator', function ($location) {