一,任务列表之菜单
ng g m task
ng g c task/task-home --spec=false
ng g c task/task-list --spec=false
ng g c task/task-item --spec=false
ng g c task/task-header --spec=false
Uncaught Error: Template parse errors:
'mat-lsit' is not a known element:
1. If 'mat-lsit' is an Angular component, then verify that it is part of this module.
list拼错了
Can't bind to 'matMenuTriggerFor' since it isn't a known property of 'div'. ("
</div>
<div mat-icon-button [ERROR ->][matMenuTriggerFor]="menu">
<mat-icon>keyboard_arrow_down</mat-icon>
"): ng:///TaskModule/TaskHeaderComponent.html@12:23
There is no directive with "exportAs" set to "matMenu" ("
---》没在shared里加MatMenuModule
几种和HTML对应组件非常像的Material组件:
复选框:md-checkbox
单选框:md-radio
下拉框:md-select
2.13 任务列表之任务组件
2.14 任务列表之新任务对话框
Datepicker:input和md-datepicker
ng g c task/new-task --spec=false
Uncaught Error: Template parse errors:
Can't bind to 'matDatepickerToggle' since it isn't a known property of 'button'. ("
>
<button type="button" matSuffix
[ERROR ->][matDatepickerToggle]="dueDatepicker">
</button>
</mat-input-container>
"): ng:///TaskModule/NewTaskComponent.html@20:8
Can't bind to 'matDatepickerToggle' since it isn't a known property of 'button'. ("
>
<button type="button" matSuffix
[ERROR ->][matDatepickerToggle]="reminderDatepicker">
</button>
</mat-input-container>
"): ng:///TaskModule/NewTaskComponent.html@35:10
----->
<!-- <button type="button" matSuffix
[mat-datepicker-toggle]="reminderDatepicker">
</button> -->
<mat-datepicker-toggle
matSuffix [for] = "reminderDatepicker">
2.15 移动内容对话框
点击移动本列表所有内容:
ERROR TypeError: _co.launchCopyTaskDislog is not a function
--->拼错了
2.16完成主框架 上
点击任务的时候弹出修改,但是点击任务前面的小框框的时候也会弹出,这样不好,
要用stopPropagation()阻止事件向上传递
删除按钮不放在project或者task里,因为用到的地方会比较多
ng g c shared/confirm-dialog --inline-template --inline-style --spec=false
inline-template是指不单独创建html模板
inline-style是指不单独创建scss
No component factory found for ConfirmDialogComponent. Did you add it to @NgModule.entryComponents?
2.16完成主框架 下
修改列表名称和新建列表点了没用:
task-header.component.html里(click)=”onEditListClick()”的地方写错了,应该写在button上面的
点击“关闭”后页面刷新:分析:应该是按钮的样式不对:
<button type="buton" mat-raised-close mat-button>关闭</button>
mat-raised-close改为mat-dialog-close
教程里还提示没有hammerJs,安装方法:cnpm install --save hammerjs
在core.module.ts里import 'hammerjs';
新增和修改,推荐复用dialog