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

fix(core): fix #4180 by adding validity check for minWidth and maxWidth #4225

Merged

Conversation

merlinchen
Copy link
Contributor

  • String and number are both allowed.
  • Valid String value will parse into number properly.
  • Invalid String value will throw an error.

if (!angular.isString(minOrMaxWidth) && !angular.isNumber(minOrMaxWidth)) {
self[name] = ((name === 'minWidth') ? 30 : 9000);
} else if (angular.isString(minOrMaxWidth)) {
if (minOrMaxWidth.match(/^(\d+)$/)) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Can you add a comment describing this regex?

@JLLeitschuh
Copy link
Contributor

This looks good. Squash it into one commit and I'd have no problem merging it in.

…and maxWidth

- String and number are both allowed.

- Valid String value will parse into number properly.

- Invalid String value will throw an error.
@merlinchen merlinchen force-pushed the col-min-and-max-width-validity-check branch from b16c2b7 to 5b03cb2 Compare August 22, 2015 06:06
@merlinchen
Copy link
Contributor Author

Squashed.

JLLeitschuh added a commit that referenced this pull request Aug 24, 2015
…ty-check

fix(core): fix #4180 by adding validity check for minWidth and maxWidth
@JLLeitschuh JLLeitschuh merged commit fb709e6 into angular-ui:master Aug 24, 2015
@merlinchen merlinchen deleted the col-min-and-max-width-validity-check branch August 25, 2015 01:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants