2014-11-07 3 views

답변

2

그냥 $ HTTP,이 같은 것을 사용

angular.module("KendoDemos", [ "kendo.directives" ]); 
function MyCtrl($scope, $http){ 

$http.get('/remoteDataSource'). 
    success(function(data) { 
     $scope.countryNames = data; 
    }); 
} 

입력 할 때 데이터가 변경되는 경우를, 당신은 또한 $ 시계를 사용할 수 있습니다 HTML에서

angular.module("KendoDemos", [ "kendo.directives" ]); 
function MyCtrl($scope, $http){ 

$scope.$watch('textboxValue', function(){ 
    $http.get('/remoteDataSource/' + $scope.textboxValue). 
     success(function(data) { 
      $scope.countryNames = data; 
     }); 
    } 
}); 
+0

하지만 $ scope.countryNames는 사용자가 입력 한 각 문자 뒤에 새로 고쳐 져야합니다. – redrom

+0

위 코드에서 이것이 어째서 그런지는 알 수 없습니다. – JMK

+0

입력에서 지정된 문자열 값을 검색하는 원격 필터에 적용된 필터 때문입니다. – redrom

0

그냥

를 사용 JS의 사용
<input kendo-auto-complete 
     k-data-text-field="'ProductName'" 
     k-data-value-field="'ProductID'" 
     k-data-source="productsDataSource" /> 

angular.module("KendoDemos", [ "kendo.directives" ]) 
    .controller("MyCtrl", function($scope){ 
     $scope.productsDataSource = { 
     type: "JSON", 
     serverFiltering: true, 
     transport: { 
      read: { 
       url: "http://demos.telerik.com/kendo-ui/service/Northwind.svc/Products", 
      } 
     } 
    }; 


    }) 
관련 문제