This repository was archived by the owner on Apr 12, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 27.4k
directive name should be trimmed #11397
Milestone
Comments
I would say we should throw. This would be an easy fix in the compiler, see Line 800 in 74eb17d
Anyone fancy sending a PR with an associated test? |
lugovsky
added a commit
to akveoDev/angular.js
that referenced
this issue
Apr 30, 2015
Throw an exception if directive name contains leading or trailing whitespaces Closes angular#11397
@pkozlowski-opensource Hey! Please check the PR for this issue. Thanks! |
lugovsky
added a commit
to akveoDev/angular.js
that referenced
this issue
Apr 30, 2015
As angular team suggested, it's better use 'baddir' error entry for whitespace validation. Closes angular#11397
lugovsky
added a commit
to akveoDev/angular.js
that referenced
this issue
Apr 30, 2015
Add additional condition, when baddir error could happen. Closes angular#11397
lugovsky
added a commit
to akveoDev/angular.js
that referenced
this issue
Apr 30, 2015
Throw an exception if directive name contains leading or trailing whitespaces Closes angular#11397
netman92
pushed a commit
to netman92/angular.js
that referenced
this issue
Aug 8, 2015
…tespace Closes angular#11397 Closes angular#11772
Be careful not to have an upper case character at the beginning of your component name. |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Directive name should probably be either trimmed or angular should throw an exception, so a typo is easier to spot. Leading or following space is clearly an error.
In the following example the name is 'directiveName ' instead of 'directiveName':
https://jsfiddle.net/c2ztgdjr/
Maybe same rule should be applied to controllers, factories etc, although it's still possible to inject those with an extra space.
The text was updated successfully, but these errors were encountered: