well, this message always showed on my console.. can someone help me to fix this out?.. btw this is ionic.. this is my controller.js
angular.module('directory.controllers', [])
.controller('EmployeeIndexCtrl', function ($scope, EmployeeService, $http) {
$scope.searchKey = "";
$scope.clearSearch = function () {
$scope.searchKey = "";
findAllEmployees();
}
$scope.search = function () {
EmployeeService.findByName($scope.searchKey).then(function (employees) {
$scope.employees = employees;
});
}
var findAllEmployees = function() {
$http({
method: 'GET',
url: 'https://miudr.000webhostapp.com'
}).then(function (res){
$scope.employees = res.data;
console.log(res);
})
}
findAllEmployees();
})
.controller('EmployeeDetailCtrl', function ($scope, $stateParams, EmployeeService) {
EmployeeService.findById($stateParams.employeeId).then(function(employee) {
$scope.employee = employee;
});
})
.controller('EmployeeReportsCtrl', function ($scope, $stateParams, EmployeeService) {
EmployeeService.findByManager($stateParams.employeeId).then(function(employees) {
$scope.employees = employees;
});
});
and this is my json.php
<?php
header("Content-type:application/json");
$connection = mysqli_connect("localhost", "root", "", "miudr") or die("Error " . mysqli_error($connection));
$sql = "select * from data";
$result = mysqli_query($connection, $sql) or die("Error " . mysqli_error($connection));
while ($row = mysqli_fetch_assoc($result)) {
$data[] = $row;
}
echo json_encode($data, JSON_PRETTY_PRINT);
mysqli_close($connection);
?>
php file is located on my hosting.. but anyway i hide my username and password as root and "".. i dont know everytime i try to show this json.. its not showing me the result.. but showing me No'Access blablabla'
btw sorry for my bad english