【发布时间】:2018-11-27 09:24:06
【问题描述】:
根据this tutorial,在Angular for Dart中定义路由时需要导入相关组件的template.dart文件:
import 'crisis_list_component.template.dart' as clct;
import 'hero_list_component.template.dart' as hlct;
我已将我的组件放在此代码所在文件夹的子文件夹中。我在lib/src/routes.dart中有导入代码:
import 'components/foobar/foobar_component.template.dart' as fct;
和lib/src/components/foobar/foorbar_component.dart 中的一个Foobar 组件。
当我在src(即与routes.dart 相同的文件夹)中有foobar_component.dart 代码时,没有问题。但是当我将它移动到它自己的子文件夹时,我得到了错误:
无法找到某些来源的模块 [...] 请检查以下导入:
import 'components/foobar/foobar_component.template.dart'
如何让它在其子文件夹中找到组件?
【问题讨论】:
标签: dart angular-dart angular-dart-routing