Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/angular/29.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
错误ng0100 ExpressionChangedTerithasBeenCheckedError in angular:表达式在检查后已更改_Angular - Fatal编程技术网

错误ng0100 ExpressionChangedTerithasBeenCheckedError in angular:表达式在检查后已更改

错误ng0100 ExpressionChangedTerithasBeenCheckedError in angular:表达式在检查后已更改,angular,Angular,我运行我的组件,我在控制台遇到一个错误,如果我在构造函数中调用服务,这个错误将被修复,但我不想中断码周期,我想在ngOnInit中调用服务,如何解决这个问题修复 显示组件: export class ShowComponent implements OnInit{ formMe: FormGroup; constructor( fb: FormBuilder, public dialogRef: MatDialogRef<DialogOverviewExampleD

我运行我的组件,我在控制台遇到一个错误,如果我在构造函数中调用服务,这个错误将被修复,但我不想中断码周期,我想在ngOnInit中调用服务,如何解决这个问题修复

显示组件:

export class ShowComponent implements OnInit{
  formMe: FormGroup;
  constructor(
    fb: FormBuilder,
    public dialogRef: MatDialogRef<DialogOverviewExampleDialog>,
    @Inject(MAT_DIALOG_DATA) public data: DialogData,
    private _service: UserService
  ) {
    this.formMe = fb.group({
      name: [""]
    });
  }
ngOnInit(): void {
this._service.getByID(this.data.id).subscribe(res=>{
  ...
  ...
  ...
})  
}

error ng0100 expressionchangedafterithasbeencheckederror in angular :expression has changed after it was checked.previous value:'trur'. current value:'false' .. find more at https://angular.io/errors/NG0100
导出类ShowComponent实现OnInit{
formMe:FormGroup;
建造师(
fb:FormBuilder,
公共dialogRef:MatDialogRef,
@注入(MAT_DIALOG_DATA)公共数据:DialogData,
私有服务:用户服务
) {
this.formMe=fb.group({
姓名:[“”]
});
}
ngOnInit():void{
this.\u service.getByID(this.data.id).subscribe(res=>{
...
...
...
})  
}
错误ng0100 ExpressionChangedTerithasBeenCheckedError角度:表达式在检查后已更改。以前的值:'trur'。当前值:'false'…在以下位置查找详细信息:https://angular.io/errors/NG0100

!!!!!!!!!!!!!!!!!!!