Convert string value as key in json object
- $scope.attVal={"a":"fsdfsdfsd","b":"asdfas","c":"asdfas","d":"","e":"fas","f":"asd","g":"","h":"","i":"","j":"","k":""};
- $scope.selectedAttribute="a";
- $scope.attrValue="asdda";
- $scope.attVal[$scope.selectedAttribute]=$scope.attrValue;
In this example you can see, we are converting a string variable into a json key. and Updating old json by key.
ReplyDeleteGood day. I was impressed with your article. Keep it up . You can also visit my site if you have time. Thank you and Bless you always.
Dedicated Angularjs Developer in India