1
내 각도 코드에서 데이터 항목 중 하나를 클릭하면 관리 페이지가 열리고 관리자 권한 구성 요소가 열리고 표시됩니다 클릭 된 항목과 관련된 데이터.Angular4/ngrx - ExpressionChangedAfterItHasBeenCheckedError : 검사 후 표현식이 변경됨
한 번 나는이 오류가 클릭 : 나는 관리자 오른쪽 하위 구성 요소를 생성하면
ERROR Error: ExpressionChangedAfterItHasBeenCheckedError: Expression has changed after it was checked. Previous value: 'false'. Current value: 'true'.
at viewDebugError (core.es5.js:8434)
at expressionChangedAfterItHasBeenCheckedError (core.es5.js:8412)
at checkBindingNoChanges (core.es5.js:8576)
at checkNoChangesNodeInline (core.es5.js:12448)
at checkNoChangesNode (core.es5.js:12422)
at debugCheckNoChangesNode (core.es5.js:13202)
at debugCheckDirectivesFn (core.es5.js:13104)
at Object.eval [as updateDirectives] (AdminComponent.html:21)
at Object.debugUpdateDirectives [as updateDirectives] (core.es5.js:13086)
at checkNoChangesView (core.es5.js:12242)
내가 오류를 받기 시작
admin.component.html :
<data-table [table]='table' [data]="data" (onSelect)="onItemSelect($event)"></data-table>
<admin-right *ngIf="showRight"
[item]="item"
[rightContent]="rightContent"></admin-right>
data-table.component.ts :
@Component({
...
changeDetection: ChangeDetectionStrategy.OnPush
})
export class DataTableComponent implements OnInit {
constructor(
private cdRef:ChangeDetectorRef
) { }
ngOnInit() {
this.cdRef.detectChanges();
}
right.component.ts :
@Component({
....
changeDetection: ChangeDetectionStrategy.OnPush
})
export class RightComponent implements OnInit {
@Input() item;
@Input() rightContent;
constructor(private cdRef:ChangeDetectorRef) { }
ngOnInit() {
this.cdRef.detectChanges();
}