这里我使用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