我有包含
的PHP文件(car_insert.php)$datasuccess = array(
"name" => "Person Name",
"email" => "Person email",
"phone" => "phone"
);
echo json_encode($datasuccess);
我的angularjs代码是
$scope.insertCarInfo=function(){
$http.post("car_insert.php",{
'REMARKS':$scope.REMARKS,
'buttonName':$scope.buttonName})
.success(function(datasuccess){
$scope.name = datasuccess.name;
$scope.email= datasuccess.email;
$scope.carDisplay();
});
};
我的HTML(index.php)文件的代码是:
Name:{{name}}
email:{{email}}
我无法获得任何输出
答案 0 :(得分:0)
$scope.name = datasuccess.name;
$scope.email= datasuccess.email;
$scope.carDisplay();
$scope.$apply();//insert this code.