這裏我使用codeigniter和AngularJS ...... 我的代碼有什麼問題?
我想要的是,我想從'輸入文本'中檢索它的數據。
而在AjaxRequest.php
在app.js$scope.testGetDataSearch = function()
{
$http({
method: 'GET',
url: 'home/naonwelah',
data: { 'valSearch': $scope.search_data }
}).then(function (success){
console.log(success.data);
},function (error){
console.log(error);
});
}
index.html中
<input type="text" ng-model="search_data">
<span class="display-ib" ng-click="testGetDataSearch()"></span>
做 '的console.log()'
時,我只得到空數據
public function naonwelah()
{
if (isset($_GET['valSearch'])) {
$searchValue = $_GET['valSearch'];
$result = $this->dbxs7h3j9213m02147ca_model->cariBrow($searchValue);
var_dump($result);
}
}
謝謝你的參與:D,這是非常好的:) – Firmansyah