I am using directives with selector of the form template[myPrefixDirectiveName] in my app, ala what ng-bootstrap does currently (see the documentation for the modal for example and the note on the <template ngbModalContainer> usage), and get warning messages like
The selector of the directive "Foo" should be used as attribute (https://goo.gl/QS8kEs)
The selector of the directive "Foo" should have prefix `my` (https://goo.gl/uacjKR)
This should be supported by Codelyzer IMO.
We're working on improving the selector-related rules so [prefixRest].bar and [prefixBar][foo] will work for directives with default settings and prefix being the "prefix".
The selector of the template directives doesn't have to include element so most likely even after the improvements your selector is going to fail for directive-selector-type.
Btw, this is an issue which should be moved to angular/angular.io but in general if you believe that your directive should include an element selector you can disable the rule like:
@Component({
/* tslint:disable-next-line:component-selector-prefix component-selector-name */
selector: 'fooBar',
template: '<h1>{{ hero.name }}</h1>'
})
class HeroDetailsComponent { }
does not work for my directives
@Directive({
/* tslint:disable-next-line:component-selector-prefix component-selector-name */
selector: '[erTable]'
})
export class ERTableDirective {
@phil123456 this should work:
@Directive({
/* tslint:disable-next-line:directive-selector */
selector: 'card-row'
})
Most helpful comment
@phil123456 this should work: