Я немного новичок в разработке угловых дротиков.Я пытаюсь использовать ящик в макете приложения.
Вот мой код для компонента
@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>
Вот ошибка веб-компилятора
[SEVERE] build_web_compilers| ddc в lib / src / app_component.template.dartdevc.module: Ошибка компиляции модуля dartdevc: web_client | lib / src / app_component.template.ddc.js
[ошибка] «ящик» получателя не являетсяопределенный для класса 'AppComponent'.(пакет: web_client / src / app_component.template.dart, строка 391, столбец 9)
Пожалуйста, исправьте все ошибки перед компиляцией (предупреждения в порядке).}
Есть идеи, почему он не может найти переменную ящика?Это экспортируется в MaterialPersistentDrawerDirective
Я использовал код из образцов здесь https://github.com/dart-lang/angular_components/blob/master/examples/app_layout_example/lib/app_layout_example.dart
Спасибо