相关疑难解决方法(0)

如何使用TypeScript定义控制器?

如何使用TypeScript定义我的控制器.现在它是在角度js但我想改变这种类型脚本.所以可以快速检索数据.

function CustomerCtrl($scope, $http, $templateCache){

    $scope.search = function(search)
    {
        debugger;
        var Search = {
            AccountId: search.AccountId,
            checkActiveOnly: search.checkActiveOnly,
            checkParentsOnly: search.checkParentsOnly,
            listCustomerType: search.listCustomerType
        };
        $scope.customer = [];
        $scope.ticket = [];
        $scope.services = [];
        $http.put('<%=ResolveUrl("API/Search/PutDoSearch")%>', Search).
            success(function(data, status, headers, config) {
                debugger;
                $scope.cust_File = data[0].customers;
                $scope.ticket_file = data[0].tickets;
                $scope.service_file = data[0].services;
            }).
            error(function(data, status)
            {
                console.log("Request Failed");
            });
    }
}
Run Code Online (Sandbox Code Playgroud)

angularjs typescript

15
推荐指数
3
解决办法
4万
查看次数

标签 统计

angularjs ×1

typescript ×1