javascript - Angular data object key rename -
i know i'm missing simple.
i have object in $scope
value. want reneame 1 of property.
so assume have
$scope.data = { prop1: value1, prop2: value2}
now want object be:
$scope.data = { newprop: value1, prop2: value2}
i tried
$scope.data.prop1 = newprop; delete $scope.data.prop1;
but have not success
how correctly angular data object?
thanks
update
for more info:
i tried update object child controller, called $scope.$parent.data
Comments
Post a Comment