mercredi 1 juin 2016

Angularjs http.delete is not working after deploying project on server

I am working on a Laravel5.1 project. While working on localhost using xampp http.delete works fine but after hosting the project on remote server this delete option is not working though other properties are working fine. here is a portion of the code

$scope.removeSaleTemp = function(id) {
        $http.delete('api/saletemp/' + id).
        success(function(data, status, headers, config) {
            $http.get('api/saletemp').success(function(data) {
                    $scope.saletemp = data;
                    });
            });
    }

'api/saletemo/' goes to SaleTempApiController

public function destroy($id)
{
    SaleTemp::destroy($id);
}

view part:

<tr ng-repeat="newsaletemp in saletemp">
                                <td>@</td><td>@</td><td>@</td><td><input type="text" style="text-align:center" autocomplete="off" name="quantity" ng-change="updateSaleTemp(newsaletemp)" ng-model="newsaletemp.quantity" size="2"></td><td>@</td><td><button class="btn btn-danger btn-xs" type="button" ng-click="removeSaleTemp(newsaletemp.id)"><span class="glyphicon glyphicon-trash" aria-hidden="true"></span></button></td>
 </tr>

Note that , This code works fine on localhost (xampp) but fails after deploying in server.



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire