I'm new to angular.js, and the $scope is not working in the function, which is inside the controller....
<div>{{logMsg}}</div> <script type="text/javascript"> angular.module("app",[] ).controller("myController", function($scope){ $scope.onConnect = function(status){ $scope.logMsg = "connecting..."; } function onMessage(msg) { console.log('message'); $scope.logMsg = "message..."; } }); </script> The connecting... is displayed, but the message... is not displayed. But I received the the message in the console. What is i'm doing wrong. Thanks in advance.
onMessagebeing called? Chances are$scopeis (ironically) not in scope.$scope.logMsginonMessagefunction is not within the scope of the controller.xmpp, from there it's calling it.. the console is working and not the $scope