각도 서비스는 http 게시를 수행하는 동안 컨트롤러의 데이터를 반환하지 않습니다.HTTP 서비스를 수행하는 동안 각도 서비스가 컨트롤러의 데이터를 반환하지 않습니다.
app.controller("letter_active", function ($scope, myService) {
$scope.artist = myService.getReplyType2();
});
app.service('myService', function ($http) {
this.getReplyType2 = function() {
$http.post('file/getReplyType', {})
.success(function (data, status) {
return data;
}).error(function (data, status) {
alert("Error has occured" + status);
});
}
});
이 나를 초보자를위한 도움이 필요 각도
당신은 사람들이 당신에게 –