0
綁定我試圖綁定用戶名和圖像URL,我通過Facebook從Facebook API得到登錄後angular2模板HTML,但它並沒有得到解決。任何一個有一個解決方案,數據從Facebook API中的角2
facbooklogin.component.ts
FB.api('/me',function(response){
this.username= response.name;
});
FB.api(
"/"+resp.authResponse.userID+"/picture",
function (response) {
if (response && !response.error) {
this.profileImg=response.data.url;
}
});
facebooklogin.component.html
<img *ngIf="authorized" [src]="profileImg">
<h2>Hello {{username}}</h2>
謝謝。明白了,愚蠢的錯誤:) – Mustafa