Я хочу щелкнуть ссылку с идентификатором из базы данных (на странице posts.html), а затем просмотреть полное содержание этой ссылки в файле display.html, используя AngularJS, MySQLi и PHP. Пожалуйста, смотрите изображение ниже:
![enter image description here](https://i.stack.imgur.com/K3uu2.png)
вот что мне удалось сделать до сих пор: Posts.html
<table class="table table-bordered" ng-controller="postController"
ng-init="show_data()">
<tr>
<th>Description</th>
</tr>
<tr ng-repeat="x in news">
<td><a href="">{{x.description}}</a></td>
</tr>
</table>
Вот мой пост-контроллер: postController.js
"USE STRICT";
app.controller('postController', function ($scope, $http) {
$scope.show_data = function () {
$http.get("display.php")
.success(function (data) {
$scope.news = data;
});
}
});
А вот мой код display.php:
<?php
require_once "config.php";
$output = array();
$query = "SELECT * FROM news";
$result = mysqli_query($conn, $query);
if (mysqli_num_rows($result) > 0) {
while ($row = mysqli_fetch_array($result)) {
$output[] = $row;
}
echo json_encode($output);
}
?>
Мой display.html:
<div >
<div>{{id}}</div>
<div>{{title}}</div>
<div>{{article}}</div>
<div>{{tag}}</div>
<div>{{author}}</div>
</div>
Как отобразить результаты, извлеченные из базы данных конкретной ссылки на display.html?