Closed atodicebear closed 8 years ago
I don't think you are calling or defining your checkName function correctly. I can't tell if your function is available in $scope or not. The example has $scope.checkName = function(data) {
.
Also, your onaftersave function is using $ctrl.saveColumn('valueTranlate')
.
Maybe your need to do something similar $ctrl.checkName ($data)
?
Got it running now thx :) Btw for what is the "column" in the saveColumn function?
// Edit Table Row
$scope.saveColumn=function() {
var results = [];
angular.forEach($scope.langV, (value) => {
results.push($http.patch('/api/dict_values/' + value.v_id, {
id: value.v_id,
value: value.value2,
user_id: Auth.getCurrentUser()._id,
key_id: value._id,
lang_id: $scope.select2
}));
});
return $q.all(results);
};
I have removed the column in
$scope.saveColumn = function(column) {
And it is still saving everything normal without Errors.
In the example, the "column" parameter was used to load data from the array.
results.push($http.post('/saveColumn', {column: column, value: user[column], id: user.id}));
You are doing something different in your saveColumn function so it's not needed.
// Edit Table Row
$scope.saveColumn=function() {
var results = [];
angular.forEach($scope.langV, (value) => {
results.push($http.patch('/api/dict_values/' + value.v_id, {
id: value.v_id,
value: value.value2,
user_id: Auth.getCurrentUser()._id,
key_id: value._id,
lang_id: $scope.select2
}));
});
return $q.all(results);
};
That is what I did and it is getting the Data from all Fields right with the Depending other Datas. Can be closed because it is working. Or Discuss for other/me/you why it is working.
I think you can go ahead and close this issue.
Hey, I took the saveColumn and CheckName Functions and Copied them without changes, only adaptation to mine Variables.
But it is not Invoking the checkName function. No Validation and not even the Console.log output. But the saveColumn is wokring fine?.