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:
@ -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