angularjs - Adding data to a list in angular js -


am receiving data in form of {room1: 4, room2: 2}

received in name of roomdata

$scope.testdata = [{         'room': 'room0',         'users': '10'     }];  $scope.setlobbyroom = function (roomdata) {      $scope.inc = 0;     (i in roomdata) {         //want push data array list here.     } } 

if want push data $scope.testdata, have use method push

$scope.testdata = [{         'room': 'room0',         'users': '10'     }];  $scope.setlobbyroom = function (roomdata) {      $scope.inc = 0;     (i in roomdata) {         $scope.testdata.push(roomdata[i]);     } } 

Comments

Popular posts from this blog

javascript - Using jquery append to add option values into a select element not working -

Android soft keyboard reverts to default keyboard on orientation change -

Rendering JButton to get the JCheckBox behavior in a JTable by using images does not update my table -