简体   繁体   English

ngu-carousel :: :: ExpressionChangedAfterItHasBeenCheckedError:表达式在检查后已更改

[英]ngu-carousel :: ExpressionChangedAfterItHasBeenCheckedError: Expression has changed after it was checked

I am referring to this example https://stackblitz.com/edit/ngu-carousel-ng6?embed=1&file=src/app/app.component.html 我指的是这个示例https://stackblitz.com/edit/ngu-carousel-ng6?embed=1&file=src/app/app.component.html

But in console, I am getting this error 但是在控制台中,我收到此错误

Error: ExpressionChangedAfterItHasBeenCheckedError: Expression has changed after it was checked. 错误:ExpressionChangedAfterItHasBeenCheckedError:检查表达式后,表达式已更改。 Previous value: 'ngForOf: '. 先前的值:“ ngForOf:”。 Current value: 'ngForOf: 0,1,2,3,4,5'. 当前值:“ ngForOf:0、1、2、3、4、5”。

Here is the workaround for your problem 是您问题的解决方法

You can use ChangeDetectionStrategy 您可以使用ChangeDetectionStrategy

like, 喜欢,

import { Component, ChangeDetectionStrategy } from '@angular/core';

    @Component({
      changeDetection: ChangeDetectionStrategy.OnPush,
      selector: 'my-app',
      templateUrl: './app.component.html',
      styleUrls: ['./app.component.css']
    })

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 共享服务:ExpressionChangedAfterItHasBeenCheckedError:检查表达式后,表达式已更改 - Shared service: ExpressionChangedAfterItHasBeenCheckedError: Expression has changed after it was checked ExpressionChangedAfterItHasBeenCheckedError:使用Angular2检查表达式后,表达式已更改 - ExpressionChangedAfterItHasBeenCheckedError: Expression has changed after it was checked using Angular2 更改动态颜色 - ExpressionChangedAfterItHasBeenCheckedError:表达式在检查后已更改 - change dynamic color - ExpressionChangedAfterItHasBeenCheckedError: Expression has changed after it was checked ExpressionChangedAfterItHasBeenCheckedError:表达式在检查后已更改。 先前的值:'ngIf:false'。 当前值:'ngIf:true' - ExpressionChangedAfterItHasBeenCheckedError: Expression has changed after it was checked. Previous value: 'ngIf: false'. Current value: 'ngIf: true' ExpressionChangedAfterItHasBeenCheckedError:检查后表达式已更改。 以前的值:'ngIf:true'。 当前值:'ngIf:false' - ExpressionChangedAfterItHasBeenCheckedError: Expression has changed after it was checked. Previous value: 'ngIf: true'. Current value: 'ngIf: false' ExpressionChangedAfterItHasBeenCheckedError:从ckEditor获取值时检查后表达式已更改 - ExpressionChangedAfterItHasBeenCheckedError: Expression has changed after it was checked while getting the value from ckEditor Ngu-Carousel Angular 7:尝试从 json 导入数据 - Ngu-Carousel Angular 7: Try to import data from json 离子2:检查后错误表达已更改 - Ionic 2: Error Expression has changed after it was checked 角度4错误:检查后表达式已更改 - Angular 4 Error: Expression has changed after it was checked “检查后表达式已更改”的控制台错误 - console error for “Expression has changed after it was checked”
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM