javascript - Updating controller data doesnt update the view - Angular JS - Ionic -
i have controller : .controller("mainctrl",function($scope,$state){ var self = this; var usuario = window.localstorage.getitem('usuario'); this.msjs=[]; var res = window.localstorage.getitem(usuario+'_msjs'); if(res===null) { this.msjs=[]; } else{ this.msjs=json.parse(res); } $scope.$on('newmessagereceived', function(e, msg) { //alert('message received:'+msg); self.msjs.push(msg); alert('mensaje recibido'); alert(json.stringify(self.msjs)); window.localstorage.setitem(usuario+'_msjs',json.stringify(self.msjs)); $state.reload(); }); } and view: <ion-view ng-controller="mainctrl m" > <ion-nav-buttons side="right"> <button class="button" ng-click="m.logout...