Angular 6 sanitize local drive url
问题 I have tried using DomSanitizer methods to sanitize the following type of url with no success C:\path\to\executable Is there any way to sanitize this url to be used as href value? Also I am binding the value with [] notation so I am sure it is not interpolated as string. 回答1: First the url should be C:/path/to/executable not the one C:\path\to\executable According to http://www.ietf.org/rfc/rfc2396.txt backslash characters are not valid characters in URLs Most of the browsers convert the