c# websocket 心跳重连_angular2及其他项目中遇到的问题和解决方法

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

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值