Friday, March 30, 2018

get data to show in angularjs - development

get data to show in angularjs

I will try to do this to show data in page, but it’s not working. Is it wrong with my source below?

  $scope.confirmCapnhat=function(id){
                if($scope.p_id!="" && $scope.dn_taoMoi!="")
                {
            //      $scope.myVar = !$scope.myVar;
                    $http.get(API+'diennuoc/capnhat/'+id).then(successCallback,errorCallback);
                    function successCallback(response){
                        console.log(response);
                        $scope.sodauDien=response.data.dn_sodauDien;
                        $scope.diennuoc=response;
                    };
                    function errorCallback(response){
                        $scope.sodauDien=0;
                        $scope.sodauNuoc=0;
                    };  
                }
                else
                alert('Chưa chọn phòng hoặc ngày lập!');

            }

And here is result when ran console.log(response).
enter image description here



from Laravel Questions and Answers https://laravelquestions.com/php/get-data-to-show-in-angularjs/
via Lzo Media

No comments:

Post a Comment