Skip to content

fix(router): add extra validation for when route was passed as Array.#9942

Merged
vicb merged 1 commit intoangular:masterfrom
bary822:router-validation-for-unexpected-type
Jul 14, 2016
Merged

fix(router): add extra validation for when route was passed as Array.#9942
vicb merged 1 commit intoangular:masterfrom
bary822:router-validation-for-unexpected-type

Conversation

@bary822
Copy link
Copy Markdown
Contributor

@bary822 bary822 commented Jul 10, 2016

Please check if the PR fulfills these requirements

What kind of change does this PR introduce? (check one with "x")

[x] Bugfix
[ ] Feature
[ ] Code style update (formatting, local variables)
[ ] Refactoring (no functional changes, no api changes)
[ ] Build related changes
[ ] CI related changes
[ ] Other... Please describe:

What is the current behavior? (You can also link to an open issue here)
When route are given as Array, Angular throws error with Invalid route configuration: routes must have path specified which does not really express what's wrong.

What is the new behavior?
Throw error with new message Invalid route configuration: Array cannot be specified.

Does this PR introduce a breaking change? (check one with "x")

[ ] Yes
[x] No

If this PR contains a breaking change, please describe the impact and migration path for existing applications: ...

Other information:
I'm certain that there are some people who think route can be given as array and it should be eventually flattened.
I hope this will them to figure out the problem they are having.
(Current error message confused me a little bit, and took sometime to resolve it.)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

use Array.isArray()

@vicb
Copy link
Copy Markdown
Contributor

vicb commented Jul 13, 2016

please update and squash your commits

@vicb vicb added feature Label used to distinguish feature request from other issues pr_state: LGTM action: cleanup The PR is in need of cleanup, either due to needing a rebase or in response to comments from reviews labels Jul 13, 2016
@bary822 bary822 force-pushed the router-validation-for-unexpected-type branch from 65acbcf to 8b900f8 Compare July 14, 2016 02:24
@bary822 bary822 force-pushed the router-validation-for-unexpected-type branch from 8b900f8 to da43c6c Compare July 14, 2016 02:53
@bary822
Copy link
Copy Markdown
Contributor Author

bary822 commented Jul 14, 2016

@vicb
Done, thanks for your comment.

@vicb vicb merged commit aa88438 into angular:master Jul 14, 2016
@angular-automatic-lock-bot
Copy link
Copy Markdown

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Sep 9, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

action: cleanup The PR is in need of cleanup, either due to needing a rebase or in response to comments from reviews cla: yes feature Label used to distinguish feature request from other issues

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants