(function () { 'use strict'; angular .module('app', []) .config(config); config.$inject = ['$provide']; function config($provide) { $provide.decorator("$route", extendRouteProvider); extendRouteProvider.$inject = ['$delegate']; function extendRouteProvider($delegate) { Object.keys($delegate.routes) .forEach(function (route) { if ( !! $delegate.routes[route].regexp) { var routeRegex = $delegate.routes[route].regexp.source; // Make regex case insensitive $delegate.routes[route].regexp = new RegExp(routeRegex, 'i'); // Add caseInsensitiveMatch property in route as true $delegate.routes[route]['caseInsensitiveMatch'] = true; } }); return $delegate; } } })();