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:
Bob Nystrom 2015-07-08 14:53:21 -07:00 committed by Tobias Bosch
parent caa252e57b
commit ac50ffca5e
3 changed files with 5 additions and 5 deletions

View File

@ -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('})');

View File

@ -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]
});
}

View File

@ -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 {}