Last active
July 16, 2018 22:10
-
-
Save addityasingh/ccffd3ea649965c0af851ff26299cd89 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(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; | |
} | |
} | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment