1
방법 1은 두 번째 방법 2처럼 ui-grid가 함수로 쓰려고하면 완벽하게 작동합니다. 무엇입니까? 그렇게하는 좋은 방법?
방법 1 :
$scope.grid_update= function() {
$http.get('/get_data').success(function (data) {
$scope.gridOptions.data = data;
}).error(function() {alert("Error")});
};
방법 2
// Function declaration
update_from_MySQL = function (URL,control) {
$http.get(URL).success(function (data) {
control=data;
}).error(function() {alert("Error");});
};
//Call function
$scope.grid_update =function({
update_from_MySQL('/get_data',$scope.gridOptions.data);
};