Skip to content
This repository has been archived by the owner on Apr 12, 2024. It is now read-only.

Allow to overwrite URL_REGEXP in urlInputType:urlValidator #5757

Closed
raulfraile opened this issue Jan 13, 2014 · 2 comments
Closed

Allow to overwrite URL_REGEXP in urlInputType:urlValidator #5757

raulfraile opened this issue Jan 13, 2014 · 2 comments

Comments

@raulfraile
Copy link

Apparently, when using type="url" with ngPattern to validate the data, angular checks first if the URL is valid according to the URL_REGEXP regular expression, and then validates the pattern. So, the data will be valid if matches both regexps.

As URL_REGEXP only allows basic/standard protocols (http, https and ftp), it is not possible to use the url type for URLs such as git://..., ssh://... or just myprotocol://..., which can make sense to use in an application.

Having an option to disable the url validation when using ngPattern would fix the issue.

@caitp
Copy link
Contributor

caitp commented Jul 25, 2014

@IgorMinar WTDY of this? It shouldn't be too different from navigator.registerProtocolHandler(), I mean if the platform exposes that, there's probably no reason why we couldn't have a similar thing, for both ngSanitize as well as the form controls

@caitp caitp added this to the 1.3.0 milestone Jul 25, 2014
@caitp
Copy link
Contributor

caitp commented Jul 25, 2014

Anyways, I'm not sure how frequently this gets run into, but I don't think it should take much code to support, so unless someone says otherwise, PRs welcome

@caitp caitp added the PRs plz! label Jul 25, 2014
@caitp caitp modified the milestones: Backlog, 1.3.0 Jul 25, 2014
@btford btford removed the gh: issue label Aug 20, 2014
Narretz added a commit to Narretz/angular.js that referenced this issue Oct 14, 2014
Narretz added a commit to Narretz/angular.js that referenced this issue Oct 17, 2014
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants