Angular4_控制台错误
来源:互联网 发布:windows复制快捷键 编辑:程序博客网 时间:2024/06/05 23:40
Expression has changed after it was checked. Previous value: 'true'. Current value: 'false'.
在Component中连续多次修改一个属性值,F12页面有报这个错,找到几个解释。
Angular utilizes zones to know when an event is fully processed by patching some async APIs like (addEventHandler, setTimeout, ...) and then runs change detection after each event.
In dev mode Angular does an additional change detection run, just after the first one. Because there was no event in between, no change should have happened.
If the model still changed, Angular considers this to be a possible bug.
That's exactly it. In development mode the change detection runs a second time and compares the current value with the first run.
If the value differs, then it "thinks" that the change was caused by itself. That's why it throws. However this doesn't happen in production mode with
enableProdMode()
.解决方案:
import { Component, enableProdMode } from '@angular/core';enableProdMode();
http://www.jianshu.com/p/a5402332315d
來源:简书
这段代码需要写在,别忘了引用 enableProdMode
- Angular4_控制台错误
- Angular4_在刷新页面时,F12“发生意外错误”。
- Angular4_ Observable和subscribe
- Angular4_管道转换大小写
- Oracle10g控制台错误
- Jython 控制台编码错误
- JAVA控制台错误处理
- myeclipse控制台错误查看
- H5 搭建控制台错误
- myeclipse控制台错误查看
- Angular4_设置延时执行函数
- VirtualBox 虚拟电脑控制台错误
- Angular4_清空input输入框
- Angular4_父子组件,组件之间交互
- 控制台标准输出以及控制台错误是不同的
- 控制台输出引起的奇怪溢出错误
- windwos7 em控制台使用操作系统用户错误
- Oracle 10g控制台登录错误解决办法
- .net 常用认证方法 forgery token 认证
- Android系统中标准Intent的使用
- DedeCMS提示你访问的用户可能已经被删除的问题
- 22个值得收藏的android开源代码-UI篇
- SubGrid 例子(摘选自easyUI api)
- Angular4_控制台错误
- haslayout详解
- 稳压电源 连载16:模板和参考电路.
- 小马的git使用记
- java中this用法
- owner:java属性文件配置
- Initializing c3p0 pool... com.mchange.v2.c3p0.ComboPooledDataSource
- openCV学习笔记(二)---openCV系列基本操作(2)
- 机器学习实用教程(译)-4