Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(UrlMatcher): Add param only type names #2289

Merged
merged 1 commit into from
Oct 6, 2015
Merged

feat(UrlMatcher): Add param only type names #2289

merged 1 commit into from
Oct 6, 2015

Conversation

filipesilva
Copy link
Contributor

nateabele added a commit that referenced this pull request Oct 6, 2015
feat(UrlMatcher): Add param only type names
@nateabele nateabele merged commit cc10786 into angular-ui:master Oct 6, 2015
@@ -917,7 +917,8 @@ function $UrlMatcherFactory() {
}

function getType(config, urlType, location) {
if (config.type && urlType) throw new Error("Param '"+id+"' has two type configurations.");
if (config.type && urlType.name !== 'string') throw new Error("Param '"+id+"' has two type configurations.");
if (config.type && urlType.name === 'string' && $types[config.type]) return $types[config.type];
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since urlType is optional, this code will break on url-less parameters. I liked the direction of your previous logic better, where it checks if config.type is a string.

angular.isString is a handy utility for checking if something is a string or not

@christopherthielen
Copy link
Contributor

I see why you made the changes you did. There are some interactions with the url param type. I'm going to take this and massage it a bit. Thanks for your efforts!

@christopherthielen
Copy link
Contributor

updated PR: #2296

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants