You're on the right track. The steps to making your Url routes insensitive are as follows:
1) Create a UrlSerializer that derives from the DefaultUrlSerializer (you did that).
import { DefaultUrlSerializer, UrlTree } from '@angular/router';
export class LowerCaseUrlSerializer extends DefaultUrlSerializer {
parse(url: string): UrlTree {
return super.parse(url.toLowerCase());
}
}
2) import your new UrlSerializer in your app.module.ts file (your path will be different):
import { LowerCaseUrlSerializer } from './common/providers/others/lowerCaseSerializer/lowerCaseSerializer';
3) Register the new UrlSerializer with your module providers in the app.module.ts file:
providers: [
{
provide: UrlSerializer,
useClass: LowerCaseUrlSerializer
}]
None of this hard. I'm just surprised that they don't add a conditional to the DefaultUrlSerializer that will allow you indicate case insensitive. Everywhere else on the Internet Urls are insensitive.