angular
水瓶紫罗兰
这个作者很懒,什么都没留下…
展开
-
angular7升级到angular8
angular7升级到angular8最近换了项目组,技术栈也更换了(原来是Vue,现在是angular)。正好赶上版本升级,于是自己尝试升级,顺便记录了过程中遇到的问题,希望可以帮到需要升级的朋友。先使用ng update 查看我们这个项目需要升级的依赖依次升级对应的依赖(根据上图中 Command to update的提示一次升级)ng update @angular/cli升级...原创 2019-09-25 18:07:34 · 3520 阅读 · 0 评论 -
ng项目 报错Cannot find control with unspecified name attribute
ng项目material日期选择器组件二次封装,使用时报错Cannot find control with unspecified name attribute???原创 2021-03-12 15:49:52 · 1473 阅读 · 0 评论 -
angular重要指令
一. 当前项目直接输入指令创建文件指令ng g c pages/nat(路径/文件名)创建moduleng g m pages/nat(路径/文件名)ng g m pages/nat --routing=true (同时创建routing文件,=true可以省略)创建serviceng g service pages/nat/service/nat(路径/文件名)二. 当前项目进入相应目录:创建文件指令ng g c nat(文件名)创建modulen原创 2020-10-10 18:03:55 · 175 阅读 · 0 评论 -
求解:ERROR Error: [@ant-design/icons-angular]:the icon plus-o does not exist or is not registered.
在使用angular + ng-zorro 开发项目时,遇到ERROR Error: [@ant-design/icons-angular]:the icon plus-o does not exist or is not registered.这个错误,项目使用的angular8版本,对应的ng-zorro也是8版本。根据错误提示,发现页面用到了以下代码<nz-tag *ngIf="!inputVisible" class="editable-tag" nzNoAnimation (click)原创 2020-06-03 14:36:45 · 3580 阅读 · 1 评论 -
angular中table绑定的值修改后,table不能渲染
记入坑angular之后,遇到的坑之一:<table mat-table [dataSource]="tableData"></table>问题:直接给tableData push或者unshift添加值,输出的tableData是多了数据,但是页面不会渲染新添加的数据;解决方案:先用深拷贝定义个临时变量缓存一下数组,操作临时变量,操作完了再把临时变量的值赋给tab...原创 2019-11-20 16:59:12 · 811 阅读 · 0 评论 -
can only be default-imported using the 'allowSyntheticDefaultImports' flag
入坑angular之后,遇到的坑之一:使用蚂蚁的这里例子可用 nzDisabledDate 和 nzDisabledTime 分别禁止选择部分日期和时间报错。具体报错信息如下:Module '"date-fns/difference_in_calendar_days"' can only be default-imported using the 'allowSyntheticDefault...原创 2019-11-08 15:55:18 · 3577 阅读 · 0 评论 -
Error: Unexpected value 'undefined' declared by the module 'MyModule'
Angular项目遇到的问题:Error: Unexpected value 'undefined' declared by the module 'MyModule'解决方案:将原module文件中的内容复制保存下来,然后粘贴到使用如下指令创建的module文件中,ng g module my-module首先用ng lint --fix修复警告,再检查是否有多余的逗号删除即可...原创 2019-09-29 14:30:49 · 1877 阅读 · 0 评论