答案 0 :(得分:0)
我必须导入父类Routes
才能使测试有效:
测试/飞镖:
import 'package:frontend/src/line/routes.dart';
import 'package:frontend/src/routes.dart' as parent_routes;
[...]
@Component(
selector: 'test',
template: '''
<my-lines></my-lines>
<router-outlet [routes]="[parent_routes.Routes.lines]"></router-outlet>
''',
directives: [RouterOutlet, LinesComponent],
exports: [parent_routes.Routes],
)
class TestComponent {
final Router router;
TestComponent(this.router);
}
我不知道这是否是正确的方法。欢迎发表评论!!!