如何从fixassid
url
route history
获取angular js controller
getpc_his
并将其传递给controller
中的<a href="{{url('history/'.$get_history_pc->fixass_id)}}">( View History )</a>
。
我的刀片模板
Route::get('history/{fixassid}',function (){
return view('assetmanagement.history.pchistory');
});
Route::get('/api/v1/pchists/{fixassid}','HistoryController@getpc_his');
我的路线
var app = angular.module('angtable', ['angularUtils.directives.dirPagination'])
.constant('API_URL', 'http://testing/mypro/public/api/v1/');
app.controller('pchistory', function ($scope, $http, API_URL) {
$scope.currentPage=1;
$scope.itemsPerPage=10;
$scope.sizes = [ {code: 0, name: '5'}];
$scope.update = function() {
//console.log($scope.item.code, $scope.item.name)
$scope.itemsPerPage= $scope.item.name;
}
//retrieve employees listing from API
$http.get(API_URL + "pchists/"+ "fixassid")
.success(function (response) {
$scope.pchists = response;
});
$scope.sort = function (keyname) {
$scope.sortKey = keyname; //set the sortKey to the param passed
$scope.reverse = !$scope.reverse; //if true make it false and vice versa
}
});
My Angular JS
public function getpc_his($fixassid){
$history=DB::table('psl_tbl_his')
->where('fixass_id',$fixassid)
->get();
return $history;
}
我的控制器
opcache_reset();