http post does not work codeigniter,angular app

Viewed 502

I am making codeigniter app with angular on client side.So my post is not working someone please help.

Angular

$scope.posaljiKontroleru = function () {
                $scope.prosek = {kalorije: 0.0, proteini: 0.0, uh: 0.0, masti: 0.0};
                $http({
                    method: 'POST',
                    url: 'http://localhost/psi/Pravljenjejela/dodajBazi',
                    data: JSON.stringify($scope.prosek),
                    headers: {'Content-Type': 'application/json'}

                }).success(function(data) {

                });
            }

CI controler

public function dodajBazi(){
        echo $this->input->post('kalorije');

    }
2 Answers
Related