Angular2 HTTP using observables subscribe showing data undefined

前端 未结 2 1173
后悔当初
后悔当初 2021-01-05 22:50

I don\'t know what I\'m doing wrong but somehow i\'m not able to read data, though the data is coming from server in response and even the data is getting showed inside serv

2条回答
  •  温柔的废话
    2021-01-05 23:38

    listByEmpId(empId:string){
    
        this.adminService.getAllocatedAssets(empId).subscribe(
        res => {
          this.allocatedAssetsList = res;
          console.log(this.allocatedAssetsList);
        },
        error =>  this.errorMessage = error);
    }
    

提交回复
热议问题