0

I couldn't find the answer anywhere. Is there a way to dynamically set the record database names while updating it via $http request?

$scope.patchSingle = function(key, recordName, recordValue) {

    $http.patch('https://DATABASE_ADDRESS/'+key+'.json', { recordName: recordValue})
    .success(function(result){
        console.log('success');
    })  
    .error(function (result) {
       console.log('error');  
    });
};

I just need to make recordName variable dynamically set by ptachSingle function argument in $http.patch request.

AL.
  • 36,815
  • 10
  • 142
  • 281
bolox
  • 1
  • 3
  • 2
    OK, found the answer, just didn`t know how to properly ask this question. Soulution I found is here http://stackoverflow.com/questions/25725081/set-a-property-of-scope-object-dynamically-in-angular-js what I need is to use [recordName] instead of recordName. – bolox Dec 13 '16 at 15:06
  • Take a look at http://stackoverflow.com/questions/19837916/creating-object-with-dynamic-keys – Paweł Kozikowski Dec 13 '16 at 15:06

0 Answers0