Skip to content

Commit 830aecd

Browse files
trezmmhevery
authored andcommitted
fix(router/parsing): change route rule error to say PascalCase instead of CamelCase
Closes angular#7874
1 parent ac6959c commit 830aecd

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

modules/@angular/router-deprecated/src/rules/rule_set.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ export class RuleSet {
4949
if (isPresent(config.name) && config.name[0].toUpperCase() != config.name[0]) {
5050
let suggestedName = config.name[0].toUpperCase() + config.name.substring(1);
5151
throw new BaseException(
52-
`Route "${config.path}" with name "${config.name}" does not begin with an uppercase letter. Route names should be CamelCase like "${suggestedName}".`);
52+
`Route "${config.path}" with name "${config.name}" does not begin with an uppercase letter. Route names should be PascalCase like "${suggestedName}".`);
5353
}
5454

5555
if (config instanceof AuxRoute) {

modules/@angular/router-deprecated/test/route_config/route_config_spec.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,7 @@ export function main() {
172172
.catch((e) => {
173173
expect(e.originalException)
174174
.toContainError(
175-
`Route "/child" with name "child" does not begin with an uppercase letter. Route names should be CamelCase like "Child".`);
175+
`Route "/child" with name "child" does not begin with an uppercase letter. Route names should be PascalCase like "Child".`);
176176
async.done();
177177
return null;
178178
})}));
@@ -185,7 +185,7 @@ export function main() {
185185
.catch((e) => {
186186
expect(e.originalException)
187187
.toContainError(
188-
`Route "/child" with name "child" does not begin with an uppercase letter. Route names should be CamelCase like "Child".`);
188+
`Route "/child" with name "child" does not begin with an uppercase letter. Route names should be PascalCase like "Child".`);
189189
async.done();
190190
return null;
191191
})}));

modules/@angular/router-deprecated/test/rules/rule_set_spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@ export function main() {
164164
expect(() => recognizer.config(
165165
new Route({path: 'app/user/:name', component: DummyCmpA, name: 'user'})))
166166
.toThrowError(
167-
`Route "app/user/:name" with name "user" does not begin with an uppercase letter. Route names should be CamelCase like "User".`);
167+
`Route "app/user/:name" with name "user" does not begin with an uppercase letter. Route names should be PascalCase like "User".`);
168168
});
169169

170170

0 commit comments

Comments
 (0)