This question might seem a bit strange. I'm trying to create functions to update the database via angular and because I'm lazy my function will be
gettable('tablebame')
It will select the table (MySQL) matching the parameter and return it. I didn't think about this issue untill I noticed it only worked with 1 table.
$scope.users = {};
var gettable = function(name) {
httpFactory.setname(name);
httpFactory.get(function(response) {
$scope./* name inserted in function here */ = response;
});
};
gettable("users");
I still had a static name where the comment is right now. I have tried things like but it doesn't work.
('$scope.' + name)
Is there any way to bind the return value 'response' to $scope. + 'name'?