There is some web application in which a factory was created to inform the user.
angular .module('app') .factory('messages', messages); function messages() { var _data = []; function _add(header, body) { if (_data == null) _data = []; _data.push({ header: header, body: body}); }; function _remove(id) { _data.splice(id, 1); } function _read() { return _data == null ? [] : _data; } return { add: _add, read: _read, remove: _remove }; } All main controllers interact with the factory. The result is displayed in the base template for all html pages:
<div class="container body-content" > @RenderBody() <div class="push-messages" ng-controller="messagesCtrl" ng-cloak> <div class="alert" ng-repeat="message in data()"> <button type="button" ng-click="removeAt($index)" class="close" data-dissmiss="alert">×</button> <strong>{{message.header}}</strong> {{message.body}} </div> </div> </div> The very messageCtrl :
angular .module('app') .controller('messagesCtrl', messagesCtrl); messagesCtrl.$inject = ['$scope', 'messages']; function messagesCtrl($scope, messages) { $scope.data = messages.read; $scope.removeAt = messages.remove; } The problem is that when you add a message from some controller, all messages except a will be displayed in the ng-repeate messagesCtrl controller. At the subsequent addition of the message b , a added inside the ng-repeate , but b is not. That is, when adding the n message, only n-1 will be displayed. If you call the add function of the messages factory inside the messages controller, then there will not be such an incomprehensible delay, the list inside ng-repeate will be updated and show all messages.
Hierarchy of controllers in battery
There is a suspicion that it behaves this way, because I generate a list of messages inside the page wizard (then the Asp.net mvc tag)
If an error occurs inside the dataSource controller, it should immediately appear in the ng-repeat mesCtrl controller. This is not happening. When you click on the update button, once again we try to get non-existent data, an error is generated, we do not see it, but an old one appears.

asp.net-mvcjust because the page is displayed through it? - Grundy