angular: Non-simple selectors should throw error
@Directive({
selector: 'parent child'
})
Should throw an error, since we don’t support selectors which cross elements.
About this issue
- Original URL
- State: closed
- Created 9 years ago
- Comments: 24 (14 by maintainers)
Commits related to this issue
- fix(Compiler): change compiler to throw selector errors fix(Compiler): change compiler to throw selector errors <BLANK LINE> This fix changes the functionality of the compiler so that it throws an ... — committed to jimthedev/angular by jimthedev 9 years ago
- fix(Compiler): change compiler to throw selector errors This fix changes the functionality of the compiler so that it throws an error when a selector that spans element boundaries are provided. Part... — committed to jimthedev/angular by jimthedev 9 years ago
- fix(Compiler): change compiler to throw selector errors This fix changes the functionality of the compiler so that it throws an error when a selector that spans element boundaries are provided. Part... — committed to jimthedev/angular by jimthedev 9 years ago
- # This is a combination of 2 commits. # The first commit's message is: fix(Compiler): change compiler to throw selector errors This fix changes the functionality of the compiler so that it throws an... — committed to jimthedev/angular by jimthedev 9 years ago
- fix(Compiler): change compiler to throw selector errors These fixes change the functionality of the compiler so that it throws an error when a selector that spans element boundaries are provided. Cl... — committed to jimthedev/angular by jimthedev 9 years ago
- fix(Compiler): change compiler to throw selector errors These fixes change the functionality of the compiler so that it throws an error when a selector that spans element boundaries are provided. Cl... — committed to jimthedev/angular by jimthedev 9 years ago
- fix(Compiler): change compiler to throw selector errors These fixes change the functionality of the compiler so that it throws an error when a selector that spans element boundaries are provided. Cl... — committed to jimthedev/angular by jimthedev 9 years ago
- fix(Compiler): change compiler to throw selector errors These fixes change the functionality of the compiler so that it throws an error when a selector that spans element boundaries are provided. Cl... — committed to jimthedev/angular by jimthedev 9 years ago
- fix(Compiler): change compiler to throw selector errors These fixes change the functionality of the compiler so that it throws an error when a selector that spans element boundaries are provided. Cl... — committed to jimthedev/angular by jimthedev 9 years ago
- fix(Compiler): change compiler to throw selector errors These fixes change the functionality of the compiler so that it throws an error when a selector that spans element boundaries are provided. Cl... — committed to jimthedev/angular by jimthedev 9 years ago
- fix(Compiler): change compiler to throw selector errors These fixes change the functionality of the compiler so that it throws an error when a selector that spans element boundaries are provided. Cl... — committed to jimthedev/angular by jimthedev 9 years ago
- fix(Compiler): change compiler to throw selector errors These fixes change the functionality of the compiler so that it throws an error when a selector that spans element boundaries are provided. Cl... — committed to jimthedev/angular by jimthedev 9 years ago
- fix(Compiler): change compiler to throw selector errors These fixes change the functionality of the compiler so that it throws an error when a selector that spans element boundaries are provided. Cl... — committed to jimthedev/angular by jimthedev 9 years ago
- fix(Compiler): change compiler to throw selector errors These fixes change the functionality of the compiler so that it throws an error when a selector that spans element boundaries are provided. Cl... — committed to jimthedev/angular by jimthedev 9 years ago
- fix(Compiler): change compiler to throw selector errors These fixes change the functionality of the compiler so that it throws an error when a selector that spans element boundaries are provided. Cl... — committed to jimthedev/angular by jimthedev 9 years ago
- fix(Compiler): change compiler to throw selector errors These fixes change the functionality of the compiler so that it throws an error when a selector that spans element boundaries are provided. Cl... — committed to jimthedev/angular by jimthedev 9 years ago
- fix(compiler): throw for hierarchical component selectors Fixes #6600 Fixes #2589 — committed to pkozlowski-opensource/angular by pkozlowski-opensource 8 years ago
- fix(compiler): throw for hierarchical component selectors Fixes #6600 Fixes #2589 — committed to pkozlowski-opensource/angular by pkozlowski-opensource 8 years ago
- fix(compiler): throw for hierarchical component selectors Fixes #6600 Fixes #2589 — committed to pkozlowski-opensource/angular by pkozlowski-opensource 8 years ago
Is there a good reason why “we don’t want to support complex selectors”? It would be a great feature though. The lack of this feature forces me to still use jquery to support already existing views with complex selector based behavior as i pointed out in my proposal #7278. It appears a bit senseless to me to write the behavior for my existing view components using jquery which will not do anything else as angular2 does anyways. Why not just support complex selectors and the world would be a better place!? At least parent > child selectors.
I think not only it should throw an error, but also an explanation for “what subset of selectors are supported” is missing in the docs. The term “(css) selector” has precise meaning in the web community and people are not going to assume a subset of css selectors are going to work when docs say:
I’m almost sure a lot of developers are getting bit by this issue, specially the “parent child” selector not working and not throwing.
It’s fine if a lint check catches this to work around this shortcoming, but ultimately this is an incorrect behavior in Angular that should be fixed.
This is still relevant. The framework should never silently accept an input that it does not support.