I am building my first angular app and I have almost finished it but I have one page left to complete that is causing me a bit of a headache.
So I have a page that lists trips I have been on. This is done with the following code.
<?php
$sql = "SELECT * FROM tripreport WHERE userid = $userid LIMIT 10";
$result = $conn->query($sql);
if ($result->num_rows > 0) {
while($row = $result->fetch_assoc()) {
?>
<div class="row">
<div class="col-lg-7 col-md-7">
<a href="#">
<img class="img-responsive" src="reportimages/<?php echo $row['banner_img'];?>" alt="">
</a>
</div>
<div class="col-lg-5 col-md-5">
<h3><?php echo $row['reportname'];?></h3>
<h4><?php echo $row['reportstartdate'];?>
<strong class="pull-right "><?php echo $row['likes'];?> Likes</strong>
</h4>
<hr class="border-gray">
<?php echo $row['reportdescription'];?>
<hr class="border-gray">
<a class="btn bg-green" href="#!/report-listing"></span>Manage</a>
</div>
</div>
</div>
So my URL is the below:
<a class="btn bg-green" href="#!/report-listing"></span>Manage</a>
I need this to get the ID from the database and have this posted to the report listing page so I can pull out corresponding reports.
I assume something needs to go in to my angular-menu.js JS to do this which currently only has:
when('/report-listing', {
templateUrl: 'pages/report-listing.php',
controller: ReportListingsCtrl,
activetab: 'report-listing'
}).
Also I think I will need something in my controller.js file which I currently have set as:
function ReportListingsCtrl($scope, $http, $timeout) {}
Any help would be appreciated.