fix(transform): handle multiple interfaces in directive processor
Comma separate the list of interfaces in the directive transformer. Closes #2941
This commit is contained in:
parent
caa252e57b
commit
ac50ffca5e
|
@ -193,9 +193,9 @@ class CreateNgDepsVisitor extends Object with SimpleAstVisitor<Object> {
|
|||
node.implementsClause.interfaces != null &&
|
||||
node.implementsClause.interfaces.isNotEmpty) {
|
||||
writer.print(''', 'interfaces': const [''');
|
||||
node.implementsClause.interfaces.forEach((interface) {
|
||||
writer.print('${interface.name}');
|
||||
});
|
||||
writer.print(node.implementsClause.interfaces
|
||||
.map((interface) => interface.name)
|
||||
.join(', '));
|
||||
writer.print(']');
|
||||
}
|
||||
writer.print('})');
|
||||
|
|
|
@ -12,6 +12,6 @@ void initReflector(reflector) {
|
|||
'factory': () => new ChangingSoupComponent(),
|
||||
'parameters': const [],
|
||||
'annotations': const [const Component(selector: '[soup]')],
|
||||
'interfaces': const [OnChange]
|
||||
'interfaces': const [OnChange, AnotherInterface]
|
||||
});
|
||||
}
|
||||
|
|
|
@ -3,4 +3,4 @@ library dinner.soup;
|
|||
import 'package:angular2/src/core/annotations_impl/annotations.dart';
|
||||
|
||||
@Component(selector: '[soup]')
|
||||
class ChangingSoupComponent implements OnChange {}
|
||||
class ChangingSoupComponent implements OnChange, AnotherInterface {}
|
||||
|
|
Loading…
Reference in New Issue