Im 각도 j를 사용하여 인쇄 된 fb 이름을 가져올 수 없습니다. 무슨 일이 일어나고 있는지 잘 모르겠습니다. 아래 코드에서 "no_name"이 인쇄됩니다. JSON 경고가 올바르게 표시됩니다. 나는 가정
I have this view code trying to print l from the scope
<div ng-controller="TestCtrl">
{{n}}
</div>
This is the controller code:
function TestCtrl($scope){
$scope.n="no_name";// default value
FB.login(function(response) {// fb login as soon as the ui loads
if (response.authResponse) {
FB.api('/me', function(response) {
alert(JSON.stringify(response));
$scope.n=response.name;
});
} else {
//do nothing..
}
});
}
당신은 명확하게해야했다 제목 좀 더 – nick