我正在使用angular和php构建项目。我有一个客户表,我可以检索所有表数据,但是当我进入特定客户时,它不会向我显示他的详细信息。有人可以帮忙吗?
customerCardDetailsCtrl.js -
"use strict";
angular.module('dataSystem').controller('customerCardDetailsCtrl', function($scope, $http ,$routeParams, $location) {
var customer_id = $routeParams.customer_id;
$scope.customer_id = customer_id;
$http.get('http://localhost:8081/hamatkin/api/get-allCustomers.php/'+ customer_id).success(function(data){
$scope.customerDetail = data;
});
});
customerCardDetails.html - 仅显示customer_id的html页面
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title></title>
</head>
<body>
<div class="customer">
<h1>כרטיס לקוח</h1>
<a href="/hamatkin/index.html#/customerCards">חזור לרשימת כרטיסי הלקוחות</a>
<h1 ng-bind="customerDetail.customer_id"></h1>
</div>
</body>
</html>
app.js -
.when('/customerCardDetails/:customer_id', {
controller: "customerCardDetailsCtrl",
templateUrl: '../hamatkin/Views/customerCardDetails.html',
screenTitle: "",
costumerHidden: false,
reportsHidden: true,
stockHidden: true,
isIncome_expensesHidden: true,
isNavTabHidden: false,
isFooterHidden: false,
ordersHidden: true