Skip to content

Commit

Permalink
fix(transform): handle multiple interfaces in directive processor
Browse files Browse the repository at this point in the history
Comma separate the list of interfaces in the directive transformer.

Closes #2941
  • Loading branch information
munificent authored and tbosch committed Jul 8, 2015
1 parent caa252e commit ac50ffc
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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('})');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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]
});
}
Original file line number Diff line number Diff line change
Expand Up @@ -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 {}

0 comments on commit ac50ffc

Please sign in to comment.