Angular Code:
sendData(obj){
const userObj = JSON.stringify(obj); console.log(userObj);
let headers = new Headers();
headers.append("Content Type","application/json");
return this.http.post('http://localhost/codeigniter/index.php/ngGet_Controller/posted', userObj, headers);
}
CoeIgniter(Controller) code:
public function posted(){
$postdata = file_get_contents("php://input");
var_dump(json_decode($postdata));
print_r($this->input->post());
}