Skip to content

Commit

Permalink
fix($compile): change directive name validation error entry
Browse files Browse the repository at this point in the history
As angular team suggested, it's better use 'baddir' error entry for whitespace validation.

Closes angular#11397
  • Loading branch information
lugovsky committed Apr 30, 2015
1 parent 974ccdd commit 4ae3873
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/ng/compile.js
Expand Up @@ -803,7 +803,7 @@ function $CompileProvider($provide, $$sanitizeUriProvider) {
throw $compileMinErr('baddir', "Directive name '{0}' is invalid. The first character must be a lowercase letter", name);
}
if (name !== name.trim()) {
throw $compileMinErr('baddirwspc',
throw $compileMinErr('baddir',
"Directive name '{0}' is invalid. The name should not contain leading or trailing whitespaces",
name);
}
Expand Down
2 changes: 1 addition & 1 deletion test/ng/compileSpec.js
Expand Up @@ -217,7 +217,7 @@ describe('$compile', function() {
expect(function() {
directive(name, function() { });
}).toThrowMinErr(
'$compile','baddirwspc', 'Directive name \'' + name + '\' is invalid. ' +
'$compile','baddir', 'Directive name \'' + name + '\' is invalid. ' +
"The name should not contain leading or trailing whitespaces");
}
assertLeadingOrTrailingWhitespaceInDirectiveName(' leadingWhitespaceDirectiveName');
Expand Down

0 comments on commit 4ae3873

Please sign in to comment.