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 != null &&
|
||||||
node.implementsClause.interfaces.isNotEmpty) {
|
node.implementsClause.interfaces.isNotEmpty) {
|
||||||
writer.print(''', 'interfaces': const [''');
|
writer.print(''', 'interfaces': const [''');
|
||||||
node.implementsClause.interfaces.forEach((interface) {
|
writer.print(node.implementsClause.interfaces
|
||||||
writer.print('${interface.name}');
|
.map((interface) => interface.name)
|
||||||
});
|
.join(', '));
|
||||||
writer.print(']');
|
writer.print(']');
|
||||||
}
|
}
|
||||||
writer.print('})');
|
writer.print('})');
|
||||||
|
@ -12,6 +12,6 @@ void initReflector(reflector) {
|
|||||||
'factory': () => new ChangingSoupComponent(),
|
'factory': () => new ChangingSoupComponent(),
|
||||||
'parameters': const [],
|
'parameters': const [],
|
||||||
'annotations': const [const Component(selector: '[soup]')],
|
'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';
|
import 'package:angular2/src/core/annotations_impl/annotations.dart';
|
||||||
|
|
||||||
@Component(selector: '[soup]')
|
@Component(selector: '[soup]')
|
||||||
class ChangingSoupComponent implements OnChange {}
|
class ChangingSoupComponent implements OnChange, AnotherInterface {}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user