[英]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.