AngularDart – A directive that implicitly adds a dependency directive?


Is it possible to have a directive that implicitly adds another dependency directive?

@Directive(selector: '[dirA]')
class DirectiveA {
  DirectiveA() { ... }

@Directive(selector: '[dirB]')
class DirectiveB {
  DirectiveB(DirectiveA a) { ... }

     template: '<div dirA dirB></div>'
     //template: '<div dirB></div>' // this is the goal
class Foo {}


No, unfortunately. As you mentioned yourself, inheritance is an option.

For example:

class AutoSuggestedOptions {}

class AutoFormattedOptions extends AutoSuggestedOptions {}

Answered By – matanlurey

Answer Checked By – Timothy Miller (FlutterFixes Admin)

Leave a Reply

Your email address will not be published. Required fields are marked *