Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/flutter/9.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
Json 无法读取属性';被称为';使用界面用户的未定义角度_Json_Angularjs - Fatal编程技术网

Json 无法读取属性';被称为';使用界面用户的未定义角度

Json 无法读取属性';被称为';使用界面用户的未定义角度,json,angularjs,Json,Angularjs,我正在使用我的用户服务代码中的服务从服务器获取数据 GetUser(id: any): Observable<User> { const header = new HttpHeaders(); header.append('content-type', 'application/json'); return this.httpclient.get<User>(this.baseurl + '/' + id, {headers: header}); } 我使用

我正在使用我的用户服务代码中的服务从服务器获取数据

GetUser(id: any): Observable<User>
{
  const header = new HttpHeaders();
  header.append('content-type', 'application/json');
  return this.httpclient.get<User>(this.baseurl + '/' + id, {headers: header});
}
我使用memberdetialcomponent.ts中的代码,这是我的代码

export class MemberDetialComponent implements OnInit {
user: User;
id: number;
  constructor(private userservice: UserService, private alertify: AlertifyService, private route: ActivatedRoute) { }

  ngOnInit() {
    this.loaduser();
    console.log(this.user);
  }
  // tslint:disable-next-line: typedef
  loaduser()
  {
    this.userservice.GetUser(+this.route.snapshot.params['id']).subscribe(
      (users: User) =>
      {
        this.user = users;
       // console.log(this.user);
      }, ( error) =>
      {
       this.alertify.error(error);
      }
    );
  }
}
当使用console.log(this.user)时;我得到的信息,但使用它在我的html它说,不能阅读您的财产知道。 这是我的html代码

<h6>
  {{user.knowas}}
</h6>

{{user.knowas}

有人能帮我解决这个问题吗?谢谢

这回答了你的问题吗?不,没用
<h6>
  {{user.knowas}}
</h6>