我对Angle dart网站开发有些陌生。 我正在尝试在我的应用布局中使用抽屉。
这是我的组件代码
@Component(
selector: 'simplesociety-app',
styleUrls: [
'package:angular_components/app_layout/layout.scss.css',
'app_component.css'
],
templateUrl: 'app_component.html',
directives: [
coreDirectives,
routerDirectives,
SocietyCreateComponent,
MemberCreateComponent,
CommitteeMemberCreateComponent,
AppHeaderComponent,
AppMenuComponent,
DeferredContentDirective,
MaterialButtonComponent,
MaterialIconComponent,
MaterialPersistentDrawerDirective,
MaterialToggleComponent,
MaterialListComponent,
MaterialListItemComponent
],
exports: [RoutePaths, Routes],
providers: [ClassProvider(SocietyService)])
class AppComponent{
final SocietyService service;
AppComponent(SocietyService this.service);
}
这是我的组成部分
<material-drawer persistent #drawer="drawer" *ngIf="service.user !=null" >
<!-- Drawer content here -->
<div class="padding10">
<app-header></app-header>
<div class="ui divider"></div>
<div *ngIf="service.app_user != null">
<app-menu></app-menu>
</div>
</div>
</material-drawer>
<material-content *ngIf="service.user != null">
<material-button icon
class="material-drawer-button" (trigger)="drawer.toggle()">
<material-icon icon="menu"></material-icon>
</material-button>
<!-- Content goes here -->
<div class="padding5">
<router-outlet [routes]="Routes.all"></router-outlet>
</div>
</material-content>
这是webbed编译器错误
[SEVERE] lib / src / app_component.template.dartdevc.module上的build_web_compilers | ddc: 编译dartdevc模块时出错:web_client | lib / src / app_component.template.ddc.js
[错误]没有为类“ AppComponent”定义吸气剂“抽屉”。 (package:web_client / src / app_component.template.dart,第391行,第9栏)
请在编译之前修复所有错误(警告可以)。 }
有人知道为什么它找不到抽屉变量吗?它在MaterialPersistentDrawerDirective中导出
谢谢