feat(dart/transform): Record Type interfaces
To support interface-based lifecycle methods (#2220), we need to be able to query for the `interface`s a class supports. Record implemented interfaces to allow mirror-less querying at runtime. Closes #2204
This commit is contained in:
@ -66,8 +66,7 @@ class _DirectiveMetadataVisitor extends Object
|
||||
callOnChange: false,
|
||||
callOnCheck: false,
|
||||
callOnInit: false,
|
||||
callOnAllChangesDone: false
|
||||
);
|
||||
callOnAllChangesDone: false);
|
||||
}
|
||||
|
||||
@override
|
||||
|
@ -192,6 +192,15 @@ class CreateNgDepsVisitor extends Object with SimpleAstVisitor<Object> {
|
||||
}
|
||||
writer.print(''', 'annotations': ''');
|
||||
node.accept(_metaVisitor);
|
||||
if (node.implementsClause != null &&
|
||||
node.implementsClause.interfaces != null &&
|
||||
node.implementsClause.interfaces.isNotEmpty) {
|
||||
writer.print(''', 'interfaces': const [''');
|
||||
node.implementsClause.interfaces.forEach((interface) {
|
||||
writer.print('${interface.name}');
|
||||
});
|
||||
writer.print(']');
|
||||
}
|
||||
writer.print('})');
|
||||
return null;
|
||||
}
|
||||
|
Reference in New Issue
Block a user