javascript - Cannot set property in an object in angular js -
this question has answer here:
$scope.objectdata = {}; $scope.objectdata[key]["digits"] = set.first+','+set.second+','+set.third+','+set.fourth;
here key numerical value.the error
typeerror: cannot set property 'digits' of undefined
you need set value of $scope.objectdata[key]
object before can add more keys it.
$scope.objectdata[key] = {}; $scope.objectdata[key]['digits'] = 'foo';
Comments
Post a Comment