从Route laravel获取参数以使用角度js路由laravel

时间:2017-12-05 08:58:20

标签: angularjs laravel laravel-5 pagination

我有两条路线,如下面的代码(角度js分页的第二条路线):

Route::get('history/{fixassid}',function (){
        return view('assetmanagement.history.pchistory');
    });
Route::get('/api/v1/pchists/','HistoryController@getpc_his');

My Angular js

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'}, {code: 1, name: '10'}, {code: 2, name: '15'}, {code: 3, name: '20'}, {code: 4, name: '30'} ];
    $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")
        .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
    }
});

当我点击刀片temaplate

<a href="{{url('history/'.$get_history_pc->fixass_id)}}">( View History )</a>

我想将fixassid传递给控制器​​HistoryController并且函数getpc_his怎么可以?

0 个答案:

没有答案