1.Module not found: Error: Can't resolve './$$_gendir/app/app.module.ngfactory'
ng build --prod 编译时报上述错误 命令更改为ng build --env=prod
2.angular-cli修改域名及端口号
找到node_modules/angular-cli/lib/config/schema.json
default值就是默认的端口
3.解决input输入框选中下面内容是,框内的背景色变为黄色的bug
input:-webkit-autofill {-webkit-box-shadow: 0 0 0px 1000px white inset;} --> css解决
4. 解决input输入框内容下面有红色波浪线的bug
spellcheck="false" 添加到html中的input元素内部
5. isNullOrUndefined --> import { isNullOrUndefined } from "util";
如果用这个判断数据类型或数据是都存在等...,清空数据时要用null / undefined;
6. 页面刷新: this.rotate.navigate(["message"]) 页面整体刷新加载: window.location.reload();
7. ... is not a known element: 1. if ... is an Angular component ... 2. if ... is a Web Component ...
这个是没有在module.ts文件里面引入component, 并且import这个component
8. 解决双击变蓝的问题
.cancelselect {
-moz-user-select: none; /*FireFox*/
-webkit-user-select: none; /*webkit browser*/
-ms-user-select: none; /*IE10*/
-khtml-user-select: none; /*早期浏览器*/
user-select: none;
}
9. 对其文本: text-align-last: justify; text-align: justify;
10. core.es5.js:350 Uncaught reflect-metadata shim is required when using class
在ployfills.ts中添加下面两句话 import 'zone.js'; import 'reflect-metadata';
11.PrimeNG 一定要在根模块引入 app.module.ts
12.报错:If ngModel is used within a form tag, either the name attribute must be set or the formcontrol must be defined as ‘standalone’ in ngModelOptions.
在ng2表单中使用ngModel需要注意,必须带有name属性或者使用 [ngModelOptions]=”{standalone: true}”,二选其一
13.强制文本一行显示,多出的省略号表示
必须同时应用三个:
text-overflow:ellipsis;
white-space:nowrap;
overflow:hidden;
强制两行显示:
overflow : hidden;
text-overflow: ellipsis;
display: -webkit-box;
-webkit-line-clamp: 2;
-webkit-box-orient: vertical;
14."Import declaration conflicts with local declaration of