-
Notifications
You must be signed in to change notification settings - Fork 27.4k
Directive requiring can't find camelCased directive with a data prefix #10722
Comments
I'm not sure I understand the problem... In your What do you mean exactly by:
|
@pkozlowski-opensource I updated the plunkr, so I found out that the bug only happens when you add data as a prefix to the directive. Basically, if my directive was named |
@moneytree-doug |
@frfancha I agree completely, but having data prefixed in the element is different from prefixing data to an attribute. But the better error here would be to say not use a data prefix instead of saying the controller cannot be found |
I don't see why, actually. |
@moneytree-doug the As to:
this is debatable - I'm not sure what spec are saying about I'm going to keep it open for a while as I'm not sure what is the best course of action here: either trying to "fix" this or just update docs.... |
BTW, (not that I recommend this, but) you can still use an element directive starting with
|
I would rather just have Angular restrict a data prefix for a directive name than telling me that it cannot find the correct controller. It just basically diverts my attention away from the correct issue, and I end up spending a few hours figuring out if its configured properly and having to debug Angular itself to figure out the issue. |
@moneytree-doug actually you are onto something - it is true that we could throw when a directive is named starting with one of the "restricted" prefixes. @petebacondarwin WDYT? |
...but they are not "restricted" :( |
@gkalpak sure, but as you've said, you wouldn't recommend people to use they directives like Maybe the right thing to do here would be to have this warning in ng-hint? |
I am just saying that they are not "restricted" directives (right now) as there is a way to use them without problems. So, although I wouldn't be opposed to making them restricted (and throwing an error), it would be a breaking change. (Not that I have anything against breaking changes; just pointing it out :)) In any case, if we decide to "keep" them, raising awareness on the directive normalization process would be nice. There is only a short mention in the 👍 for |
This is either a configuration issue or a parsing issue. I keep getting these errors:
https://docs.angularjs.org/error/$compile/ctreq?p0=superhero&p1=strength
https://docs.angularjs.org/error/$compile/ctreq?p0=super-hero&p1=invis
The code is in the plnkr below. http://plnkr.co/edit/Ofq6OXE1tTTIIKMCZic6
I would expect the consistent camelCasing to work, but that doesnt see to be the case here.
The text was updated successfully, but these errors were encountered: