angularjs - $scope.msgs.push is not a function at n.$scope.send_msg -


i trying create chat application have push message user-1 user-2 privately. create $scope.msgs=[]; variable store message.this code not code, took source code here.

here send message function send message.

                $scope.msgs.push({                      msg:$scope.send_text,                     from_id:$scope.uid,                     to_id:$scope.send_to_userinfo.id,                     timestamp:math.floor(new date() / 1000)                 });                 $scope.send_text="";                 $scope.self.scrolldiv();                 console.log($scope.msgs);             }            

instead of one---> $scope.msgs=[]; , try var msgs=[]; . hope works .


Comments

Popular posts from this blog

magento2 - Magento 2 admin grid add filter to collection -

Android volley - avoid multiple requests of the same kind to the server? -

Combining PHP Registration and Login into one class with multiple functions in one PHP file -