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
Post a Comment