0
为什么我的隐藏在失败的json请求上?为什么我的隐藏工作?
<div ng-controller="MainController">
<div ng-hide="onError">
Name: {{ user.name}}
Location: {{ user.location}}
Image: <img ng-src="{{user.avatar_url}}" />
</div>
</div>
var MainController = function ($scope, $http) {
var onUserComplete = function (response) {
$scope.user = response.data;
}
var onError = function (reason) {
$scope.error = "Could not fetch the user";
return true;
}
$http.get("https://api.github.com/users/robconery")
.then(onUserComplete, onError);
}