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

Popular posts from this blog

ruby on rails - Permission denied @ sys_fail2 - (D:/RoR/projects/grp/public/uploads/ -

c++ - nodejs socket.io closes connection before upgrading to websocket -

python - PyQt: Label not showing correct number of length -