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(router/parsing): change route rule error to say PascalCase not CamelCase #7874

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion modules/angular2/src/router/rules/rule_set.ts
Expand Up @@ -53,7 +53,7 @@ export class RuleSet {
if (isPresent(config.name) && config.name[0].toUpperCase() != config.name[0]) {
let suggestedName = config.name[0].toUpperCase() + config.name.substring(1);
throw new BaseException(
`Route "${config.path}" with name "${config.name}" does not begin with an uppercase letter. Route names should be CamelCase like "${suggestedName}".`);
`Route "${config.path}" with name "${config.name}" does not begin with an uppercase letter. Route names should be PascalCase like "${suggestedName}".`);
}

if (config instanceof AuxRoute) {
Expand Down
Expand Up @@ -180,7 +180,7 @@ export function main() {
.catch((e) => {
expect(e.originalException)
.toContainError(
`Route "/child" with name "child" does not begin with an uppercase letter. Route names should be CamelCase like "Child".`);
`Route "/child" with name "child" does not begin with an uppercase letter. Route names should be PascalCase like "Child".`);
async.done();
return null;
})}));
Expand All @@ -193,7 +193,7 @@ export function main() {
.catch((e) => {
expect(e.originalException)
.toContainError(
`Route "/child" with name "child" does not begin with an uppercase letter. Route names should be CamelCase like "Child".`);
`Route "/child" with name "child" does not begin with an uppercase letter. Route names should be PascalCase like "Child".`);
async.done();
return null;
})}));
Expand Down
2 changes: 1 addition & 1 deletion modules/angular2/test/router/rules/rule_set_spec.ts
Expand Up @@ -169,7 +169,7 @@ export function main() {
expect(() => recognizer.config(
new Route({path: 'app/user/:name', component: DummyCmpA, name: 'user'})))
.toThrowError(
`Route "app/user/:name" with name "user" does not begin with an uppercase letter. Route names should be CamelCase like "User".`);
`Route "app/user/:name" with name "user" does not begin with an uppercase letter. Route names should be PascalCase like "User".`);
});


Expand Down