我现在正在学习Angular2。在这一课中,我读到我必须将数据保存到"any“数组中,然后是这样的代码:
import { Component } from '@angular/core';
import { GithubService } from '../../services/github.service';
@Component({
selector: 'profile',
template: `<h1>Profile Component</h1>`,
})
export class ProfileComponent {
user:any[];
constructor(private _githubService:GithubService){
// this._githubService.getUser().subscribe(user => {console.log(user)});
this._githubService.getUser().subscribe(user => {
this.user = user;
});
}
}什么是user:any[];?我试着在github上的google上搜索它,但什么也没找到。不知道要读什么事件。
https://stackoverflow.com/questions/44510301
复制相似问题