我正在将应用程序迁移到 Dart 2 和 Angular 5。我在 html 文件中有这段代码
<material-list-item *ngFor="let key of keyList"
(trigger)="clickItem(key)">{{key}}
</material-list-item>
如果我在相应的 dart 文件中声明使用“materialDirectives”,一切正常,但如果我只导入“MaterialListItemComponent”,则不会触发对该项目的点击。
我实际上尝试添加更多指令,但使用以下列表不起作用:
MaterialButtonComponent,
MaterialIconComponent,
MaterialDialogComponent,
MaterialListComponent,
MaterialListItemComponent,
MaterialInputComponent,
MaterialPopupComponent,
ModalComponent,
PopupSourceDirective,
ButtonDirective.
materialDirectives 已弃用,如果没有必要,我不想包含所有内容。寻找这个问题的答案,同时寻找一种方法来识别不同组件使用哪些指令。